chess.controller.Controller Class
Game controller base class. This class acts as the glue between game models and views. When something happens in current game, it sends a message/event to the controller. The controller delegates this message to the views and all views interested
Item Index
Methods
Methods
flipBoard
()
Flip board. The only thing this method does is to fire the flipBoard event.
Returns:
getCurrentModel
()
Return active game
Returns:
loadNextGame
()
Load next game in selected database. This method will only work if you have a grid with list of games. The only thing this method does is to fire the "nextGame" event which the list of games grid listens to. The grid will go to next game and fire it's selectGame event
Returns:
loadPreviousGame
()
Load previous game from selected database. For info, see loadNextGame
Returns:
nextMove
()
Go to next move
Returns:
pauseGame
()
Pause auto play of moves
Returns:
playMoves
()
Start auto play of moves in current game from current position
Returns:
previousMove
()
Go to previous move
Returns:
toEnd
()
Go to end of current game
Returns:
toStart
()
Go to start of current game
Returns:
Events
commentAfter
Event fired when the Comment after a move dialog should be shown.
Event Payload:
-
currentModel
chess.model.Game -
move
Object
commentBefore
Event fired when the Comment before a move dialog should be shown.
Event Payload:
-
currentModel
chess.model.Game -
move
Object
flip
flip event. A board is example of a view listening to this event. When it's fired, the board will be flipped
newGameDialog
New game dialog event
nextGame
next game event