use of eidolons.game.battlecraft.ai.elements.actions.Action in project Eidolons by IDemiurge.
the class ActionSequenceConstructor method getSequencesFromPaths.
public List<ActionSequence> getSequencesFromPaths(List<ActionPath> paths, Task task, Action action) {
List<ActionSequence> list = new ArrayList<>();
for (ActionPath path : paths) {
if (!TimeLimitMaster.checkTimeLimitForAi(getUnitAI()))
break;
ActionSequence sequence = new ActionSequence(path.getActions(), task, task.getAI());
if (action.getActive().isRanged()) {
List<Action> rangedAttackSequence = constructSingleAttackSequence(action, task);
if (rangedAttackSequence.isEmpty()) {
return list;
}
// TODO
sequence.getActions().addAll(rangedAttackSequence);
} else {
sequence.getActions().add(action);
}
list.add(sequence);
}
return list;
}
use of eidolons.game.battlecraft.ai.elements.actions.Action in project Eidolons by IDemiurge.
the class PathSequenceConstructor method getOptimalPathSequence.
public ActionPath getOptimalPathSequence(UnitAI ai, Coordinates targetCell) {
List<DC_ActiveObj> moves = AiUnitActionMaster.getMoveActions(ai.getUnit());
Action action = AiActionFactory.newAction("Move", ai);
List<Coordinates> coordinates = new ArrayList<>();
coordinates.add(targetCell);
List<ActionPath> paths = getPathSequences(moves, action, coordinates);
// });
return paths.get(0);
}
use of eidolons.game.battlecraft.ai.elements.actions.Action in project Eidolons by IDemiurge.
the class AtomicAi method getAtomicActionMove.
public Action getAtomicActionMove(UnitAI ai, Boolean approach_retreat_search) {
Coordinates pick = null;
boolean b = isHotzoneMode();
if (b) {
pick = getHotZoneCell(ai, approach_retreat_search);
} else {
pick = getApproachCoordinate(ai);
}
if (pick == null)
pick = b ? getApproachCoordinate(ai) : getHotZoneCell(ai, approach_retreat_search);
if (pick == null)
return null;
Action a = getAtomicMove(pick, ai.getUnit());
return a;
}
use of eidolons.game.battlecraft.ai.elements.actions.Action in project Eidolons by IDemiurge.
the class AtomicAi method getAtomicActionForced.
public Action getAtomicActionForced(UnitAI ai) {
Action action = null;
action = getAtomicActionDoor(ai);
if (action != null)
action.setTaskDescription("Door");
return action;
}
use of eidolons.game.battlecraft.ai.elements.actions.Action in project Eidolons by IDemiurge.
the class AtomicAi method getAtomicActionTurn.
public Action getAtomicActionTurn(UnitAI ai) {
Coordinates pick = getApproachCoordinate(ai);
if (pick == null)
return null;
List<Action> sequence = getTurnSequenceConstructor().getTurnSequence(FACING_SINGLE.IN_FRONT, getUnit(), pick);
if (ListMaster.isNotEmpty(sequence))
return sequence.get(0);
return null;
}
Aggregations