use of main.elements.targeting.SelectiveTargeting in project Eidolons by IDemiurge.
the class Targeter method canTargetAny.
public boolean canTargetAny() {
Targeting targeting = getTargeting();
if (!(targeting instanceof SelectiveTargeting)) {
return true;
}
Map<FACING_DIRECTION, Boolean> map = getTargetingAnyCache().get(getOwnerObj().getCoordinates());
if (map == null) {
map = new HashMap<>();
targetingAnyCache.put(getOwnerObj().getCoordinates(), map);
}
Boolean canTargetAny = map.get(getOwnerObj().getFacing());
if (canTargetAny == null) {
canTargetAny = !targeting.getFilter().getObjects(getRef()).isEmpty();
}
map.put(getOwnerObj().getFacing(), canTargetAny);
return canTargetAny;
}
Aggregations