/* * @see riskarena.RiskBot#fortifyPosition() */ public void fortifyPosition() { eval.refresh( "fortifyPosition() in Awesome"); // The game state has changed since last updating the // evaluator for (Integer i : posFortifier.decide()) { to_game.sendInt(i); } }
/* * Use a FortifyArmiesDecision to make this choice * @see riskarena.RiskBot#fortifyTerritory(int) */ public void fortifyTerritory(int num_to_place) { eval.refresh( "fortifyTerritory() in Awesome"); // The game state has changed since last updating the // evaluator ArrayList<ArmyChange> choices = fortifier.decideAll(num_to_place); attackDecider.initTurn(); // New attack targets are chosen when new territories are being placed for (ArmyChange choice : choices) { to_game.sendInt(choice.ID()); to_game.sendInt(choice.amount()); } }
/* * Called every time this player's turn is over. * @see riskarena.RiskBot#endTurn() */ public void endTurn() { eval.endTurn(); }
/* * Turn-based initialization * @see riskarena.RiskBot#initTurn() */ public void initTurn() { card.setVictory(false); // Signal that a victory has not been achieved this turn eval.refresh( "initTurn() in Awesome"); // The board state has changed, refresh the Evaluation instance }
/* * Called to send the decision of which territory to attack (if any). * @see riskarena.RiskBot#launchAttack() */ public void launchAttack() { eval.refresh("launchAttack() in Awesome"); // Refresh the evaluation of the game state for (Integer toSend : attackDecider.decide()) { to_game.sendInt(toSend); } }
/* * Called when the game is over so that new training weights can be saved * @see riskarena.RiskBot#endGame(int) */ public void endGame(int place) { eval.endGame(place); }