use of eidolons.game.battlecraft.ai.UnitAI in project Eidolons by IDemiurge.
the class OrderMaster method checkOrderCompleted.
public static boolean checkOrderCompleted(Action action) {
UnitAI ai = action.getSource().getAI();
Order order = ai.getCurrentOrder();
Task task = action.getTask();
return false;
}
use of eidolons.game.battlecraft.ai.UnitAI in project Eidolons by IDemiurge.
the class WanderAi method checkWanderDirectionChange.
public static Boolean checkWanderDirectionChange(GroupAI group, GOAL_TYPE type) {
boolean change = false;
if (checkUnitArrived(group.getLeader().getUnitAI(), type)) {
change = true;
} else {
List<UnitAI> forwards = new ArrayList<>();
for (Unit unit : group.getMembers()) {
UnitAI ai = unit.getUnitAI();
boolean done = checkUnitArrived(ai, type);
if (!done) {
done = checkProgressObstructed(group.getWanderDirection(), ai, type);
}
if (done) // if (PositionMaster.getDistance(c,
// m.getUnit().getCoordinates()) > max)
{
forwards.add(ai);
if (forwards.size() > Math.round(group.getMembers().size() * getCatchUpFactor(group, type))) {
// if (group.isCatchUp())
// change = null;
// if units are too far
// laggers.add(ai);
// cannot be a lagger if obstructed?
change = true;
break;
}
}
}
// need to have most units far enough?
// distance from each other? don't forget the leader... he is
// special
}
return change;
}
use of eidolons.game.battlecraft.ai.UnitAI in project Eidolons by IDemiurge.
the class DebugMaster method editAi.
public void editAi(Unit unit) {
UnitAI ai = unit.getUnitAI();
GroupAI group = ai.getGroup();
DialogMaster.confirm("What to do with " + group);
String TRUE = "Info";
String FALSE = "Set Behavior";
String NULL = "Set Parameter";
String string = "What to do with " + group + "?";
Boolean result = DialogMaster.askAndWait(string, TRUE, FALSE, NULL);
LogMaster.log(1, " ");
DIRECTION info = group.getWanderDirection();
// TODO GLOBAL AI LOG LEVEL
if (result == null) {
AI_PARAM param = new EnumMaster<AI_PARAM>().retrieveEnumConst(AI_PARAM.class, ListChooser.chooseEnum(AI_PARAM.class));
if (param != null) {
switch(param) {
case LOG_LEVEL:
ai.setLogLevel(DialogMaster.inputInt(ai.getLogLevel()));
break;
}
}
}
/*
* display on BF: >> Direction >> Target coordinate for each unit or
* patrol >> Maybe even path... >>
*
*
*/
group.getPatrol();
}
Aggregations