simulations.core.history
Class PlayerTurn

java.lang.Object
  extended by simulations.core.history.PlayerTurn
All Implemented Interfaces:
java.lang.Cloneable

public class PlayerTurn
extends java.lang.Object
implements java.lang.Cloneable

This class describes a player's turn


Constructor Summary
PlayerTurn()
          Constructor
PlayerTurn(Player player, Player attackedPlayer, java.util.ArrayList playersAcceptingSupport, java.util.ArrayList playersRefusingSupport, boolean success)
          Creates a new instance of PlayerTurn
 
Method Summary
 boolean equals(java.lang.Object o)
          overide of the equals method
 Player getAttackedPlayer()
          Getter for property attackedPlayer.
 PlayerTurn getClone()
          This method returns a clone of PlayerTurn
 Player getPlayer()
          Getter for property player.
 java.util.ArrayList getPlayersAcceptingSupport()
          Getter for property playersAcceptingSupport.
 java.util.ArrayList getPlayersRefusingSupport()
          Getter for property playersRefusingSupport.
 boolean isSuccess()
          Getter for property success.
 void print()
          Print the player turn
 void setAttackedPlayer(Player attackedPlayer)
          Setter for property attackedPlayer.
 void setPlayer(Player player)
          Setter for property player.
 void setPlayersAcceptingSupport(java.util.ArrayList playersAcceptingSupport)
          Setter for property playersAcceptingSupport.
 void setPlayersRefusingSupport(java.util.ArrayList playersRefusingSupport)
          Setter for property playersRefusingSupport.
 void setSuccess(boolean success)
          Setter for property success.
 java.lang.String toString()
          Overload of toString() method
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PlayerTurn

public PlayerTurn(Player player,
                  Player attackedPlayer,
                  java.util.ArrayList playersAcceptingSupport,
                  java.util.ArrayList playersRefusingSupport,
                  boolean success)
Creates a new instance of PlayerTurn

Parameters:
success - True if the attack was a success false otherwise
player - The attacking player
attackedPlayer - The attacked player
playersAcceptingSupport - The list of players accepting to help the attack
playersRefusingSupport - The list of players refusing to help the attack

PlayerTurn

public PlayerTurn()
Constructor

Method Detail

equals

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

Overrides:
equals in class java.lang.Object
Parameters:
o - The object to compare
Returns:
true if the object are equal

toString

public java.lang.String toString()
Overload of toString() method

Overrides:
toString in class java.lang.Object
Returns:
The player of the playerTurn

print

public void print()
Print the player turn


getAttackedPlayer

public Player getAttackedPlayer()
Getter for property attackedPlayer.

Returns:
Value of property attackedPlayer.

setAttackedPlayer

public void setAttackedPlayer(Player attackedPlayer)
Setter for property attackedPlayer.

Parameters:
attackedPlayer - New value of property attackedPlayer.

getPlayer

public Player getPlayer()
Getter for property player.

Returns:
Value of property player.

setPlayer

public void setPlayer(Player player)
Setter for property player.

Parameters:
player - New value of property player.

getPlayersAcceptingSupport

public java.util.ArrayList getPlayersAcceptingSupport()
Getter for property playersAcceptingSupport.

Returns:
Value of property playersAcceptingSupport.

setPlayersAcceptingSupport

public void setPlayersAcceptingSupport(java.util.ArrayList playersAcceptingSupport)
Setter for property playersAcceptingSupport.

Parameters:
playersAcceptingSupport - New value of property playersAcceptingSupport.

getPlayersRefusingSupport

public java.util.ArrayList getPlayersRefusingSupport()
Getter for property playersRefusingSupport.

Returns:
Value of property playersRefusingSupport.

setPlayersRefusingSupport

public void setPlayersRefusingSupport(java.util.ArrayList playersRefusingSupport)
Setter for property playersRefusingSupport.

Parameters:
playersRefusingSupport - New value of property playersRefusingSupport.

getClone

public PlayerTurn getClone()
This method returns a clone of PlayerTurn

Returns:
returns a clone of PlayerTurn

isSuccess

public boolean isSuccess()
Getter for property success.

Returns:
Value of property success.

setSuccess

public void setSuccess(boolean success)
Setter for property success.

Parameters:
success - New value of property success.