use of main.system.auxiliary.SearchMaster in project Eidolons by IDemiurge.
the class RestCondition method check.
@Override
public boolean check(Ref ref) {
// check whole party!
// check anyone has food
List<Unit> allies = getGame().getMetaMaster().getPartyManager().getParty().getMembers();
boolean hasFood = false;
for (Unit sub : allies) {
int distance = getGame().getAiManager().getAnalyzer().getClosestEnemyDistance(sub);
// return false;
if (new SearchMaster<DC_HeroItemObj>().find(FOOD_ITEM, sub.getInventory(), true) != null)
hasFood = true;
}
if (true)
return true;
return hasFood;
}
Aggregations