org.dartra.framework
Interface Turn

All Superinterfaces:
Persistent
All Known Implementing Classes:
StandardTurn

public interface Turn
extends Persistent

The turn of a player in a game. A turn consists of several throws.

Turn objects have reference semantics. Each turn is unique.

Author:
Erwin Vervaet

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.
 
Methods inherited from interface org.dartra.framework.Persistent
getId, setId
 

Method Detail

getGame

public Game getGame()

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.


getPlayer

public Player getPlayer()

Returns the player involved in this turn.


getActualPlayer

public Player getActualPlayer()

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.


addThrow

public void addThrow(Throw t)

Add a throw to this turn.


getThrow

public Throw getThrow(int index)

Get specified throw of this turn.


getThrows

public java.util.Vector getThrows()

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


setValid

public void setValid(boolean b)

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


isValid

public boolean isValid()

Return whether or not this was a valid turn.