/** * Returns the number of first selectable entity */ public int getFirstEntityNum() { return game.getFirstEntityNum(getMyTurn()); }
/** * Calculates the targeting/offboard turn * This includes firing TAG and non-direct-fire artillery * Does nothing in this implementation. */ protected void calculateTargetingOffBoardTurn() { sendAttackData(game.getFirstEntityNum(getMyTurn()), new Vector<>(0)); sendDone(true); }
static PhysicalOption calculatePhysicalTurn(TestBot bot) { int entNum = bot.getGame().getFirstEntityNum(bot.getMyTurn()); int first = entNum; do { // take the first entity that can do an attack Entity en = bot.getGame().getEntity(entNum); PhysicalOption bestAttack = getBestPhysical(en, bot.getGame()); if (bestAttack != null) { return bestAttack; } // End no-attack entNum = bot.getGame().getNextEntityNum(bot.getMyTurn(), entNum); } while ((entNum != -1) && (entNum != first)); // Didn't find any physical attack. return null; }
@Override public void calculateFiringTurn() { int first_entity = game.getFirstEntityNum(getMyTurn()); int entity_num = first_entity; int best_entity = first_entity;
} else { sendAttackData(game.getFirstEntityNum(getMyTurn()), new Vector<>(0));