package com.publicuhc.pluginframework.commands.routes;

import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;

public class RouteMatcher {

    private final Route m_route;

    public RouteMatcher(Route route) {
        m_route = route;
    }

    public boolean matches(CommandSender sender, Command command, String args) {
        Route currentRoute = m_route;
        while(currentRoute != null) {
            if(!currentRoute.matches(sender, command, args)) {
                return false;
            }
            currentRoute = currentRoute.getNextChain();
        }
        return true;
    }
}

@@ -1,8 +1,812 @@
+/*%0A * RouteMatcher.java%0A *%0A * Copyright (c) 2014 Graham Howden %3Cgraham_howden1 at yahoo.co.uk%3E.%0A *%0A * This file is part of PluginFramework.%0A *%0A * PluginFramework is free software: you can redistribute it and/or modify%0A * it under the terms of the GNU General Public License as published by%0A * the Free Software Foundation, either version 3 of the License, or%0A * (at your option) any later version.%0A *%0A * PluginFramework is distributed in the hope that it will be useful,%0A * but WITHOUT ANY WARRANTY; without even the implied warranty of%0A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the%0A * GNU General Public License for more details.%0A *%0A * You should have received a copy of the GNU General Public License%0A * along with PluginFramework.  If not, see %3Chttp ://www.gnu.org/licenses/%3E.%0A */%0A%0A
 package 

add copyright