/** filter out ground and air then call specific brain determining action */
 public FieldFighter.Hittable.CharacterEnums.ECharacterAction determine(HittableCharacter me, HittableTarget groundTarget, HittableTarget airTarget)
 {
     myTarget = groundTarget;
     if (me.myType == CharacterEnums.EType.BOTH)
     {
         myTarget = airTarget.inFront(airTarget, groundTarget);
     }
     else if (me.myType == CharacterEnums.EType.AIR)
     {
         myTarget = airTarget;
     }
     return(determineAction(me, myTarget));
 }
Пример #2
0
 private void spawn(HittableCharacter c)
 {
     if (getMoney() - c.getSpawnCost() < 0)
     {
         Logger.i(ToString() + " couldn't afford " + c.ToString() + " ($" + (getMoney() - c.getSpawnCost()) + ")");
         return;
     }
     else
     {
         money -= c.getSpawnCost();
         Logger.i(ToString() + " spawned " + c.ToString() + " ($" + getMoney() + ")");
     }
     if (facing == CharacterEnums.EDirection.RIGHT)
     {
         c.spawn(xCoordinate + castleTexture.Width + 1, facing);
     }
     else
     {
         c.spawn(xCoordinate - 1, facing);
     }
     characterTotals.add(c.spawnAttribute);
     characters.Insert(0, c);
 }
 public abstract FieldFighter.Hittable.CharacterEnums.ECharacterAction determineAction(HittableCharacter me, HittableTarget frontEnemy);