/* * AcceptAttackedPlayersWeakestThanMe.java * * Created on May 16, 2004, 1:12 AM */ package simulations.core.strategy.decisionSupportStrategy; import simulations.core.Player; import java.util.ArrayList; /** * This class describes a decision support strategy that accept to help * attacks on players weakest than the owner of this strategy * @author tom */ public class AcceptAttackedPlayersWeakestThanMeStrategy extends DecisionSupportStrategy { /** Creates a new instance of AcceptAttackedPlayersWeakestThanMe */ public AcceptAttackedPlayersWeakestThanMeStrategy() { super(); name="AcceptAttackedPlayersWeakestThanMeStrategy"; memoryParam=false; abr="4"; } /** return the description of this attack strategy * @return return the description of this attack strategy **/ public String getDescription() { return "Decision support : I accept to help\n"+ "players that attack players that have \n"+ "less points than me\n"; } /** 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(simulations.core.Player player, simulations.core.Player attackingPlayer, simulations.core.Player attackedPlayer, java.util.ArrayList playerList) { if (player.equals(attackedPlayer)) { return false; } if (player.getHitPoints()