#include <GameModule.h>
Inheritance diagram for CGameModule:

Public Member Functions | |
| CGameModule () | |
| CGameModule. | |
| virtual | ~CGameModule () |
| ~CGameModule | |
| uint64 | GetGameTime () const |
| GetGameTime. | |
| void | SetDelayStart (bool bStart=true) |
| StartGame. | |
| void | StartGame () |
| StartGame. | |
| bool | IsGameOver () const |
| IsGameOver. | |
| virtual void | SetTimePerMove (uint64 sec, bool moveTimerOn=false) |
| SetTimePerMove. | |
| virtual void | SetGameTime (uint64 sec, bool gameTimerOn=false) |
| SetGameTime. | |
Protected Member Functions | |
| virtual void | NewGame ()=0 |
| NewGame. | |
| virtual void | PlayMove (const CMove *m)=0 |
| PlayMove. | |
| virtual bool | CheckMove (const CMove *m)=0 |
| CheckMove. | |
| virtual bool | CheckForWin ()=0 |
| CheckForWin. | |
| virtual void | InvalidMoveProcessing (const CMove *m)=0 |
| InvalidMoveProcessing. | |
| virtual void | UpdateCurrentPlayerPiece ()=0 |
| UpdateCurrentPlayerPiece. | |
| virtual void | SetPlayerDescription () |
| SetPlayerDescription. | |
| virtual void | AddPlayer (CDescription desc)=0 |
| AddPlayer. | |
| virtual void | RemovePlayer (CDescription desc)=0 |
| RemovePlayer. | |
| virtual void | TimeElapsed (const CPlayerPiece *piece)=0 |
| TimeElapsed. | |
| virtual void | OnGameSpecificMessage (const CGameMessage *pMsg) |
| OnGameSpecificMessage. | |
| virtual CMove * | RelayMove (CEID playerID, CMove *pMove) |
| RelayMove. | |
| void | AssignPlayerPiece (CEID id, const CPiece *p) |
| AssignPlayerPiece. | |
| void | PostInitMessage () |
| PostInitMessage. | |
Description: Base class for Game Modules used to speed up the creation of Game Module writing.
Limitations: NONE
|
|
CGameModule. Description: Class constructor Limitations: NONE |
|
|
~CGameModule Description: Class deconstructor Limitations: NONE |
|
|
AddPlayer. Description: Adds a player to the game. Should set m_bReadyToStart to true if the game is ready to start. You can assign the player a piece using the AssignPlayerPiece function.
Implemented in CBackgammonGM, COthelloGM, CStrategoGM, and CTicTacToeGM. |
|
||||||||||||
|
AssignPlayerPiece. Description: Assigns a piece to a player.
|
|
|
CheckForWin. Description: Checks for a win condition. If true, the function will set the m_winningMsg and m_winningMsgLength variables accordingly.
Implemented in CBackgammonGM, COthelloGM, CStrategoGM, and CTicTacToeGM. |
|
|
CheckMove. Description: Checks a move and returns true if it is valid and false otherwise.
Implemented in CBackgammonGM, COthelloGM, CStrategoGM, and CTicTacToeGM. |
|
|
GetGameTime. Description:
|
|
|
InvalidMoveProcessing. Description: Called when an invalid move was discovered. Set m_bGameOver to true and set the m_winningMsg & m_winningMsgLength values if you want the game to end.
Implemented in CBackgammonGM, COthelloGM, CStrategoGM, and CTicTacToeGM. |
|
|
IsGameOver. Description: Starts a new game.
|
|
|
NewGame. Description: Initalizes the game board and sets the m_curPiece value to the first player that should play.
Implemented in CBackgammonGM, COthelloGM, CStrategoGM, and CTicTacToeGM. |
|
|
OnGameSpecificMessage. Description: Used to process other game specific game messages
Reimplemented in CStrategoGM. |
|
|
PlayMove. Description: Plays a move by updating the game board.
Implemented in CBackgammonGM, COthelloGM, CStrategoGM, and CTicTacToeGM. |
|
|
PostInitMessage. Description: Post the initial message to start the game
|
|
||||||||||||
|
RelayMove. Description: Used to determine which parts of a move a given player is allowed to see
Reimplemented in CStrategoGM. |
|
|
RemovePlayer. Description: Removes a player to the game. Set m_bReadyToStart to false if the game is no longer ready to start.
Implemented in CBackgammonGM, COthelloGM, CStrategoGM, and CTicTacToeGM. |
|
|
StartGame. Description: Starts a new game.
|
|
||||||||||||
|
SetGameTime. Description: Sets the number of seconds allowed per person per game.
|
|
|
SetPlayerDescription. Description: Sets the m_PlayerInfo variable with the correct data. Override this function and set your information.
Reimplemented in CBackgammonGM, COthelloGM, CStrategoGM, and CTicTacToeGM. |
|
||||||||||||
|
SetTimePerMove. Description: Sets the maximum number of milliseconds allowed per move.
|
|
|
StartGame. Description: Starts a new game.
|
|
|
TimeElapsed. Description: Called when either a player's move time or game time has expired
Implemented in CBackgammonGM, COthelloGM, CStrategoGM, and CTicTacToeGM. |
|
|
UpdateCurrentPlayerPiece. Description: Updates the value of the m_curPiece variable to the piece that should play now.
Implemented in CBackgammonGM, COthelloGM, CStrategoGM, and CTicTacToeGM. |