use of main.elements.conditions.standard.OwnershipCondition in project Eidolons by IDemiurge.
the class FilterMaster method getPlayerControlledUnits.
public static Set<Obj> getPlayerControlledUnits(Player player) {
Conditions c = new Conditions();
Ref ref;
if (player == Player.NEUTRAL) {
c.add(new OwnershipCondition("MATCH", true));
c.add(ConditionMaster.getBFObjTypesCondition());
ref = new Ref(player.getGame());
} else {
c.add(new OwnershipCondition("MATCH", "SOURCE"));
c.add(ConditionMaster.getBFObjTypesCondition());
ref = player.getHeroObj().getRef();
}
// spells too?
Filter<Obj> filter = new Filter<>(ref, c);
Set<Obj> set = filter.getObjects();
return set;
}
Aggregations