use of main.content.enums.system.AiEnums.AI_TYPE in project Eidolons by IDemiurge.
the class CompanionMaster method getAiType.
private static AI_TYPE getAiType(Unit hero) {
AI_TYPE type = new EnumMaster<AI_TYPE>().retrieveEnumConst(AI_TYPE.class, hero.getProperty(PROPS.AI_TYPE));
if (type != null) {
main.system.auxiliary.log.LogMaster.log(1, hero.getName() + "'s Ai Type is pre-set: " + type);
return type;
}
int maxWeight = 0;
int total = 0;
for (AI_TYPE v : aiTypes) {
int weight = getWeight(v, hero);
total += weight;
if (logged)
main.system.auxiliary.log.LogMaster.log(1, v + "-Ai Type has " + weight + " weight for " + hero.getName());
if (weight > maxWeight) {
maxWeight = weight;
type = v;
}
}
// main.system.auxiliary.log.LogMaster.log(1, hero.getName() + "'s Ai Type chosen: " + type);
return type;
}
Aggregations