simulations.core.strategy.attackStrategy
Class AttackStrategy

java.lang.Object
  extended by simulations.core.strategy.Strategy
      extended by simulations.core.strategy.attackStrategy.AttackStrategy
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
AttackAttackedPlayersStrategy, AttackAttackedPlayersStrategy2, AttackRandomlyStrategy, AttackStrongestStrategy, AttackStrongestThanMeStrategy, AttackTheMostAttackedPlayerStrategy, AttackTheMostSuccessfulyAttackedPlayerStrategy, AttackWeakestStrategy, AttackWeakestThanMeStrategy, CoalitionalDef1AttackStrategy, CoalitionalDef2AttackStrategy, CoalitionalDef3AttackStrategy, CoalitionalDef4AttackStrategy, CoalitionalDef5AttackStrategy, SpitefulAttackStrategy, SpitefulAttackStrategy2

public abstract class AttackStrategy
extends Strategy
implements java.io.Serializable, java.lang.Cloneable

This abstract class describes haw to construct an attack strategy

See Also:
Serialized Form

Field Summary
protected  boolean memoryParam
          True if the strategy is memory signifiant
protected  boolean negative
          True if the strategy is the negation
 
Fields inherited from class simulations.core.strategy.Strategy
abr, memory, name, randomGenerator
 
Constructor Summary
AttackStrategy()
          Creates a new instance of AttackStrategy
 
Method Summary
 boolean equals(java.lang.Object o)
          overload of equals method
abstract  java.lang.String getDescription()
          return the description of this attack strategy
abstract  java.util.ArrayList getPlayerToAttack(Player player, java.util.ArrayList playerList)
          return the player to attack
 boolean isMemoryParam()
          Getter for property memoryParam.
 boolean isNegative()
          Getter for property negative.
 void setMemoryParam(boolean memoryParam)
          Setter for property memoryParam.
 void setNegative(boolean negative)
          Setter for property negative.
abstract  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.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
 

Field Detail

negative

protected boolean negative
True if the strategy is the negation


memoryParam

protected boolean memoryParam
True if the strategy is memory signifiant

Constructor Detail

AttackStrategy

public AttackStrategy()
Creates a new instance of AttackStrategy

Method Detail

getPlayerToAttack

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

Parameters:
player - The attacking player
playerList - The list of avalaible player
Returns:
The player to attack

updateLastTurn

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

Parameters:
turn - The turn
player - The owner of the strategy
remainingPlayers - The list of the remaining players

getDescription

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

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

equals

public boolean equals(java.lang.Object o)
overload of equals method

Overrides:
equals in class Strategy
Parameters:
o - The object to compare
Returns:
Returns true if this and o are equals

isNegative

public boolean isNegative()
Getter for property negative.

Returns:
Value of property negative.

setNegative

public void setNegative(boolean negative)
Setter for property negative.

Parameters:
negative - New value of property negative.

isMemoryParam

public boolean isMemoryParam()
Getter for property memoryParam.

Returns:
Value of property memoryParam.

setMemoryParam

public void setMemoryParam(boolean memoryParam)
Setter for property memoryParam.

Parameters:
memoryParam - New value of property memoryParam.