package in.twizmwaz.cardinal.module.modules.filter.parsers;

import in.twizmwaz.cardinal.GameHandler;
import in.twizmwaz.cardinal.module.GameObjective;
import in.twizmwaz.cardinal.module.modules.filter.FilterParser;
import in.twizmwaz.cardinal.module.modules.team.TeamModule;
import in.twizmwaz.cardinal.util.TeamUtils;
import org.jdom2.Element;

public class ObjectiveFilterParser extends FilterParser {

    private GameObjective objective;
    private TeamModule team;
    private boolean any;

    public ObjectiveFilterParser(final Element element) {
        super(element);
        String name = element.getText();
        for (GameObjective objective : GameHandler.getGameHandler().getMatch().getModules().getModules(GameObjective.class)) {
            if (objective.getName().equalsIgnoreCase(name)) this.objective = objective;
        }
        try {
            String team = element.getAttributeValue("team");
            this.team = TeamUtils.getTeamById(team);
        } catch (NullPointerException e) {
        }
        try {
            this.any = Boolean.getBoolean(element.getAttributeValue("any"));
        } catch (NullPointerException e) {
            any = false;
        }

    }

    public GameObjective getObjective() {
        return objective;
    }

    public TeamModule getTeam() {
        return team;
    }

    public boolean isAny() {
        return any;
    }
}

@@ -774,66 +774,1069 @@
 .get
-Name().equalsIgnoreCase(name)) this.objective = objective;
+Id().replaceAll(%22 %22, %22%22).equalsIgnoreCase(name.replaceAll(%22 %22, %22%22))) %7B%0A                this.objective = objective;%0A            %7D%0A        %7D%0A        for (GameObjective objective : GameHandler.getGameHandler().getMatch().getModules().getModules(GameObjective.class)) %7B%0A            if (objective.getId().replaceAll(%22 %22, %22%22).toLowerCase().startsWith(name.replaceAll(%22 %22, %22%22).toLowerCase())) %7B%0A                this.objective = objective;%0A            %7D%0A        %7D%0A        for (GameObjective objective : GameHandler.getGameHandler().getMatch().getModules().getModules(GameObjective.class)) %7B%0A            if (objective.getName().replaceAll(%22 %22, %22%22).equalsIgnoreCase(name.replaceAll(%22 %22, %22%22))) %7B%0A                this.objective = objective;%0A            %7D%0A        %7D%0A        for (GameObjective objective : GameHandler.getGameHandler().getMatch().getModules().getModules(GameObjective.class)) %7B%0A            if (objective.getName().replaceAll(%22 %22, %22%22).toLowerCase().startsWith(name.replaceAll(%22 %22, %22%22).toLowerCase())) %7B%0A                this.objective = objective;%0A            %7D
 %0A   

Add more ways to parse for an objective in the filter parser