cz.cvut.agents.rph.core
Class GameModel

java.lang.Object
  extended by cz.cvut.agents.rph.core.GameModel
Direct Known Subclasses:
ReversiModel

public abstract class GameModel
extends java.lang.Object

Model of the game - should store all the data about the game, no GUI no logic here. Author: Ondrej Vanek Date: 10/3/12 Time: 9:51 AM


Nested Class Summary
static class GameModel.GameStatus
          Status of the game.
 
Field Summary
protected  GameModel.GameStatus gameStatus
          Actual status of the game.
private  java.util.Collection<GameView> views
          Collection of views.
 
Constructor Summary
GameModel()
           
 
Method Summary
 void addView(GameView view)
           
abstract  ReversiGameResult getGameResult()
           
 GameModel.GameStatus getGameStatus()
           
abstract  boolean isEndOfGame()
           
 void notifyViews()
           
 void removeView(GameView view)
           
abstract  void restart()
           
 void setGameStatus(GameModel.GameStatus gameStatus)
          TODO: The notification of the views is done here - not decided yet, if it's clever.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

views

private java.util.Collection<GameView> views
Collection of views.


gameStatus

protected GameModel.GameStatus gameStatus
Actual status of the game.

Constructor Detail

GameModel

public GameModel()
Method Detail

addView

public final void addView(GameView view)

removeView

public final void removeView(GameView view)

notifyViews

public final void notifyViews()

restart

public abstract void restart()

setGameStatus

public void setGameStatus(GameModel.GameStatus gameStatus)
TODO: The notification of the views is done here - not decided yet, if it's clever.

Parameters:
gameStatus -

getGameResult

public abstract ReversiGameResult getGameResult()

isEndOfGame

public abstract boolean isEndOfGame()

getGameStatus

public GameModel.GameStatus getGameStatus()