simulations.core.strategy.attackStrategy
Class SpitefulAttackStrategy2
java.lang.Object
simulations.core.strategy.Strategy
simulations.core.strategy.attackStrategy.AttackStrategy
simulations.core.strategy.attackStrategy.SpitefulAttackStrategy2
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable
public class SpitefulAttackStrategy2
- extends AttackStrategy
This class describes a second spiteful strategy. It attack the player(s)
that attack me directly or indirectly
- See Also:
- Serialized Form
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 java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
SpitefulAttackStrategy2
public SpitefulAttackStrategy2()
- Creates a new instance of SpitefulAttackStrategy2
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 playerplayerList
- 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 turnplayer
- The owner of the strategyremainingPlayers
- The list of the remaining players