com.askywhale.missing
Class Game

java.lang.Object
  extended by com.askywhale.missing.Game

public class Game
extends java.lang.Object

The game : do not know anything about the interface, but everything about the real game


Field Summary
static int STATE_GAME_ENDED
           
static int STATE_JUST_CREATED
           
static int STATE_MATCH_ENDED
           
static int STATE_PLAYING
           
 
Constructor Summary
Game(Game oldGame)
          copy constructor to avoid clone
Game(java.util.List<Player> players, int maxScore)
           
 
Method Summary
 void addObserver(GameObserver go)
           
 void doContinue()
          called by interface : replace main loop : go to the next stage of the game
 void doStartNewGame()
          called by interface : start a new game
 Player getBestPlayer()
           
 boolean getGameAtEnd()
           
 boolean getMatchAtEnd()
           
 int getMaxScore()
           
 int getMissingChildren()
           
 Player getNextPlayer()
           
 int getNextPlayerNr()
           
 java.util.List<Player> getPlayers()
           
 int getState()
           
 void incNextPlayer()
           
 void removeObserver(GameObserver go)
           
 void setMaxScore(int maxScore)
           
 void setNextPlayerNr(int nextPlayer)
           
 void setPlayers(java.util.List<Player> players)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATE_JUST_CREATED

public static final int STATE_JUST_CREATED
See Also:
Constant Field Values

STATE_PLAYING

public static final int STATE_PLAYING
See Also:
Constant Field Values

STATE_GAME_ENDED

public static final int STATE_GAME_ENDED
See Also:
Constant Field Values

STATE_MATCH_ENDED

public static final int STATE_MATCH_ENDED
See Also:
Constant Field Values
Constructor Detail

Game

public Game(java.util.List<Player> players,
            int maxScore)

Game

public Game(Game oldGame)
copy constructor to avoid clone

Parameters:
oldGame - game to copy
Method Detail

doContinue

public void doContinue()
called by interface : replace main loop : go to the next stage of the game


doStartNewGame

public void doStartNewGame()
called by interface : start a new game


getMissingChildren

public int getMissingChildren()

getBestPlayer

public Player getBestPlayer()

getGameAtEnd

public boolean getGameAtEnd()

getMatchAtEnd

public boolean getMatchAtEnd()

getNextPlayerNr

public int getNextPlayerNr()

setNextPlayerNr

public void setNextPlayerNr(int nextPlayer)

getNextPlayer

public Player getNextPlayer()

incNextPlayer

public void incNextPlayer()

getPlayers

public java.util.List<Player> getPlayers()

setPlayers

public void setPlayers(java.util.List<Player> players)

getState

public int getState()

getMaxScore

public int getMaxScore()

setMaxScore

public void setMaxScore(int maxScore)

addObserver

public void addObserver(GameObserver go)

removeObserver

public void removeObserver(GameObserver go)