/* * NeverAcceptToSupportStrategy.java * * Created on April 9, 2004, 2:49 AM */ package simulations.core.strategy.decisionSupportStrategy; import simulations.core.Player; import java.util.ArrayList; import java.util.Iterator; import simulations.core.history.Turn; /** This class describes a decision support strategy that never accept to support * attack * @author tom */ public class NeverAcceptToSupportStrategy extends DecisionSupportStrategy { /** Creates a new instance of NeverAcceptToSupportStrategy */ public NeverAcceptToSupportStrategy() { super(); name="NeverAcceptToSupportStrategy"; memoryParam=false; abr="15"; } /** return true if the player will support the attack. * @return return true if the player will support the attack. * @param player The owner of the strategy * @param attackingPlayer The attacking player * @param attackedPlayer The attacked player * @param playerList The list of remaining players */ public boolean supportAttack(Player player, Player attackingPlayer, Player attackedPlayer, ArrayList playerList) { if (negative) { if (player.equals(attackedPlayer)) { return false; } return true; } else { return false; } } /** This method is called by the judge to inform players of the last turn * @param turn The turn * @param player The owner of the strategy * @param remainingPlayers The list of the remaining players */ public void updateLastTurn(Turn turn, Player player, ArrayList remainingPlayers) { } /** * This method is called by the judge after the decision of players to attack and to ask supports * to inform the strategy * @param player The owner of the strategy * @param attacksList The list of attacks **/ public void updateAttacksInfos(Player player, ArrayList attacksList) { } /** return the description of this decision support strategy * @return return the description of this decision support strategy **/ public String getDescription() { return "Support decision strategy : \n"+ "I never accept to support an attack\n"; } }