simulations.core.strategy.attackStrategy
Class AttackTheMostAttackedPlayerStrategy

java.lang.Object
  extended by simulations.core.strategy.Strategy
      extended by simulations.core.strategy.attackStrategy.AttackStrategy
          extended by simulations.core.strategy.attackStrategy.AttackTheMostAttackedPlayerStrategy
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class AttackTheMostAttackedPlayerStrategy
extends AttackStrategy

This class describes an attack strategy that attack the player the most attacked in the game

See Also:
Serialized Form

Field Summary
 
Fields inherited from class simulations.core.strategy.attackStrategy.AttackStrategy
memoryParam, negative
 
Fields inherited from class simulations.core.strategy.Strategy
abr, memory, name, randomGenerator
 
Constructor Summary
AttackTheMostAttackedPlayerStrategy()
          Creates a new instance of AttackTheMostAttackedPlayerStrategy
 
Method Summary
 java.lang.String getDescription()
          return the description of this attack strategy
 java.util.ArrayList getPlayerToAttack(Player player, java.util.ArrayList playerList)
          return the player to attack
 void updateLastTurn(Turn turn, Player player, java.util.ArrayList remainingPlayers)
          This method is called by the judge to inform players of the last turn
 
Methods inherited from class simulations.core.strategy.attackStrategy.AttackStrategy
equals, isMemoryParam, isNegative, setMemoryParam, setNegative
 
Methods inherited from class simulations.core.strategy.Strategy
getAbr, getMemory, getName, getRandomGenerator, setAbr, setMemory, setName, setRandomGenerator, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AttackTheMostAttackedPlayerStrategy

public AttackTheMostAttackedPlayerStrategy()
Creates a new instance of AttackTheMostAttackedPlayerStrategy

Method Detail

getDescription

public java.lang.String getDescription()
return the description of this attack strategy

Specified by:
getDescription in class AttackStrategy
Returns:
return the description of this attack strategy

getPlayerToAttack

public java.util.ArrayList getPlayerToAttack(Player player,
                                             java.util.ArrayList playerList)
return the player to attack

Specified by:
getPlayerToAttack in class AttackStrategy
Parameters:
player - The attacking player
playerList - The list of avalaible player
Returns:
The player to attack

updateLastTurn

public void updateLastTurn(Turn turn,
                           Player player,
                           java.util.ArrayList remainingPlayers)
This method is called by the judge to inform players of the last turn

Specified by:
updateLastTurn in class AttackStrategy
Parameters:
turn - The turn
player - The owner of the strategy
remainingPlayers - The list of the remaining players