Ejemplo n.º 1
0
 /*
  * @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);
   }
 }
Ejemplo n.º 2
0
 /*
  * 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());
   }
 }
Ejemplo n.º 3
0
 /*
  * Called every time this player's turn is over.
  * @see riskarena.RiskBot#endTurn()
  */
 public void endTurn() {
   eval.endTurn();
 }
Ejemplo n.º 4
0
 /*
  * 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
 }
Ejemplo n.º 5
0
 /*
  * 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);
   }
 }
Ejemplo n.º 6
0
 /*
  * 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);
 }