de.palmmedia.yahtzee.game
Class GameContext

java.lang.Object
  extended by de.palmmedia.yahtzee.game.GameContext

public class GameContext
extends Object

The context containing all states required for the game.

Author:
Daniel Palme

Field Summary
 int currentPlayerIndex
          The index of the current player.
 int currentStep
          The current step/round in the game (1-13).
 Dice[] dices
          The dices.
 Element markedElement
          The marked/selected element.
 List<Player> players
          The players.
 int rollCount
          The number of dice rolls of the current player (1-3)
 
Constructor Summary
GameContext(List<Player> players)
          Constructor.
 
Method Summary
 Player getCurrentPlayer()
          Gets the current player.
 int getNumberOfPlayers()
          Gets the number of players.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

players

public List<Player> players
The players.


markedElement

public Element markedElement
The marked/selected element.


dices

public Dice[] dices
The dices.


rollCount

public int rollCount
The number of dice rolls of the current player (1-3)


currentStep

public int currentStep
The current step/round in the game (1-13).


currentPlayerIndex

public int currentPlayerIndex
The index of the current player.

Constructor Detail

GameContext

public GameContext(List<Player> players)
Constructor.

Parameters:
players - The players.
Method Detail

getCurrentPlayer

public Player getCurrentPlayer()
Gets the current player.

Returns:
The current player.

getNumberOfPlayers

public int getNumberOfPlayers()
Gets the number of players.

Returns:
The number of players.