use of eidolons.game.module.dungeoncrawl.ai.AiBehavior in project Eidolons by IDemiurge.
the class BehaviorMaster method getBehavior.
private AiBehavior getBehavior(UnitAI ai, AI_BEHAVIOR_MODE type) {
AiBehavior behavior = behaviorMap.get(type);
if (behavior != null) {
return behavior;
}
switch(type) {
case WANDER:
behavior = new WanderAi();
break;
case AMBUSH:
break;
case AGGRO:
break;
case STALK:
break;
case PATROL:
break;
case GUARD:
behavior = new GuardAi();
break;
}
behaviorMap.put(type, behavior);
// preCheck unit is viable?
return behavior;
}
use of eidolons.game.module.dungeoncrawl.ai.AiBehavior in project Eidolons by IDemiurge.
the class ExplorationAiMaster method getOrders.
private ActionSequence getOrders(UnitAI ai) {
if (// TODO
ai.getUnit().isMine())
if (master.getPartyMaster().isFollowOn(ai.getUnit())) {
// isFollow
Action move = master.getPartyMaster().getFollowMove(ai.getUnit());
if (move == null) {
return null;
// return getIdleOrders(ai);
} else {
return new ActionSequence(GOAL_TYPE.MOVE, move);
}
}
// get orders?
AiBehavior behavior = getAiBehavior(ai);
ActionSequence orders = behavior.getOrders(ai);
if (orders == null) {
// orders= getIdleOrders(ai);
}
return orders;
}
Aggregations