}
protected void calculateMyTurn() {
try {
if (game.getPhase() == IGame.Phase.PHASE_MOVEMENT) {
MovePath mp = null;
if (game.getTurn() instanceof GameTurn.SpecificEntityTurn) {
GameTurn.SpecificEntityTurn turn = (GameTurn.SpecificEntityTurn) game
.getTurn();
Entity mustMove = game.getEntity(turn.getEntityNum());
mp = continueMovementFor(mustMove);
} else {
if (config.isForcedIndividual()) {
Entity mustMove = getRandomUnmovedEntity();
mp = continueMovementFor(mustMove);
} else {
mp = calculateMoveTurn();
}
}
moveEntity(mp.getEntity().getId(), mp);
} else if (game.getPhase() == IGame.Phase.PHASE_FIRING) {
calculateFiringTurn();
} else if (game.getPhase() == IGame.Phase.PHASE_PHYSICAL) {
PhysicalOption po = calculatePhysicalTurn();
// Bug #1072137: don't crash if the bot can't find a physical.