org.dartra.standard
Class StandardTurn

java.lang.Object
  extended byorg.dartra.standard.PersistentObject
      extended byorg.dartra.standard.StandardTurn
All Implemented Interfaces:
Persistent, Turn

public class StandardTurn
extends PersistentObject
implements Turn

Standard implementation of the Turn interface.

Author:
Erwin Vervaet

Constructor Summary
StandardTurn(Game game, Player player)
           
 
Method Summary
 void addThrow(Throw t)
          Add a throw to this turn.
 Player getActualPlayer()
          Returns the player that actually executed the turn.
 Game getGame()
          Returns the game that this turn is part of.
 Player getPlayer()
          Returns the player involved in this turn.
 Throw getThrow(int index)
          Get specified throw of this turn.
 java.util.Vector getThrows()
          Get this turn's throws.
 boolean isValid()
          Return whether or not this was a valid turn.
 void setValid(boolean b)
          Set whether or not this was a valid turn.
 java.lang.String toString()
           
 
Methods inherited from class org.dartra.standard.PersistentObject
getId, setId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.dartra.framework.Persistent
getId, setId
 

Constructor Detail

StandardTurn

public StandardTurn(Game game,
                    Player player)
Method Detail

getGame

public Game getGame()
Description copied from interface: Turn

Returns the game that this turn is part of. For a simple game, this will return the same game as the game the player is active in. However, for matches, the player is active in the match, but this method returns the actual game in the match the turn is part of.

Specified by:
getGame in interface Turn

getPlayer

public Player getPlayer()
Description copied from interface: Turn

Returns the player involved in this turn.

Specified by:
getPlayer in interface Turn

getActualPlayer

public Player getActualPlayer()
Description copied from interface: Turn

Returns the player that actually executed the turn. For simple players, this will be the same player as returned by the getPlayer() method. For teams however, the getPlayer() method will return the team that was active during the turn, and this method will return the player on that team that actually executed the turn.

Specified by:
getActualPlayer in interface Turn

addThrow

public void addThrow(Throw t)
Description copied from interface: Turn

Add a throw to this turn.

Specified by:
addThrow in interface Turn

getThrow

public Throw getThrow(int index)
Description copied from interface: Turn

Get specified throw of this turn.

Specified by:
getThrow in interface Turn

getThrows

public java.util.Vector getThrows()
Description copied from interface: Turn

Get this turn's throws. The resulting list contains Throw objects.

Specified by:
getThrows in interface Turn

setValid

public void setValid(boolean b)
Description copied from interface: Turn

Set whether or not this was a valid turn. This is decided by the game.

Specified by:
setValid in interface Turn

isValid

public boolean isValid()
Description copied from interface: Turn

Return whether or not this was a valid turn.

Specified by:
isValid in interface Turn

toString

public java.lang.String toString()