|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jrummikub.control.GameControl
public class GameControl
Controls a Game, at some point including all Rounds, starts new Rounds
Field Summary | |
---|---|
protected java.util.List<Connection> |
connections
|
protected Event |
endOfGameEvent
|
protected GameSettings |
gameSettings
|
protected GameState |
gameState
|
protected RoundControl |
roundControl
|
protected SaveControl |
saveControl
|
protected IView |
view
|
Constructor Summary | |
---|---|
GameControl(GameSettings gameSettings,
SaveControl saveControl,
IView view)
Constructor |
Method Summary | |
---|---|
void |
abortGame()
Clean abortion of a running game when another one is loaded or when a new one is started |
void |
continueGame(GameState gameState,
IRoundState roundState)
Continues game after loading |
protected RoundControl |
createRoundControl(IRoundState roundState)
Creates a new round control with the specified round state |
protected IRoundState |
createRoundState()
Creates a new round State |
private void |
endGame()
Ends the running game |
private void |
endOfRound(Score roundScore)
Sets the score and default values for saving when round ends |
private void |
endProgram()
Exits System without warnings if no game control is active |
IEvent |
getEndOfGameEvent()
Is emitted when the user ends the game and start a new one |
private void |
prepareRound(IRoundState roundState)
Prepare a new round by setting start player, adding listeners |
private void |
removeListeners()
Removes all listeners from the connection |
private void |
restartRound()
Restarts round after redealing |
private void |
showScorePanel()
Sets score panel visible |
protected void |
showWinPanel()
|
void |
startGame()
Game gets started by initializing the first Round |
protected void |
startRound()
Start a new round within the existing game |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected SaveControl saveControl
protected GameSettings gameSettings
protected IView view
protected RoundControl roundControl
protected GameState gameState
protected java.util.List<Connection> connections
protected Event endOfGameEvent
Constructor Detail |
---|
public GameControl(GameSettings gameSettings, SaveControl saveControl, IView view)
gameSettings
- the game settingssaveControl
- the save controlview
- the viewMethod Detail |
---|
public IEvent getEndOfGameEvent()
private void endGame()
private void removeListeners()
public void startGame()
public void continueGame(GameState gameState, IRoundState roundState)
gameState
- the saved GameState (Players, startplayer, points)roundState
- the saved RoundState (activePlayer, Table, heap etc)public void abortGame()
protected void startRound()
private void prepareRound(IRoundState roundState)
roundState
- of current roundprotected IRoundState createRoundState()
protected RoundControl createRoundControl(IRoundState roundState)
roundState
- for new round control
private void restartRound()
private void endOfRound(Score roundScore)
roundScore
- score for ended roundprivate void showScorePanel()
protected void showWinPanel()
private void endProgram()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |