#include <GUIController.h>
Inheritance diagram for CGUIController:

Public Member Functions | |
| CGUIController (QWidget *target) | |
| CGUIController. | |
| CGUIController (QWidget *target, uint32 studentID, const int8 *name, uint32 nameLength, CaffeineGUID gameID, bool bIsSpectator=false) | |
| CGUIController. | |
| ~CGUIController () | |
| CGUIController. | |
| void | StartNewGame () |
| StartNewGame. | |
| void | Stop () |
| Stop. | |
| bool | IsUsingCaffeine () const |
| IsUsingCaffeine. | |
Protected Member Functions | |
| void | run () |
| run | |
| void | PostEvent (CGameEvent *pGameEvent) |
| PostEvent. | |
| bool | UserMove (CMove *) |
| UserMove. | |
| virtual void | NewGame ()=0 |
| NewGame. | |
| virtual void | PlayMove (const CMove *m)=0 |
| PlayMove. | |
| virtual bool | CheckMove (CMove *m)=0 |
| CheckMove. | |
| virtual bool | CheckForWin ()=0 |
| CheckForWin. | |
| virtual void | UpdateCurrentPlayerPiece ()=0 |
| UpdateCurrentPlayerPiece. | |
| virtual void | SetPlayerPiece (const CPiece *p)=0 |
| SetPlayerPiece. | |
| virtual void | Play (const CPiece *p)=0 |
| Play. | |
| virtual void | TimeElapsed (const CPlayerPiece *piece)=0 |
| TimeElapsed. | |
Description: A generic base controller class for game GUIs.
Limitations: NONE
|
|
CGUIController. Description: Class constructor
|
|
||||||||||||||||||||||||||||
|
CGUIController. Description: Class constructor
|
|
|
CGUIController. Description: Class deconstructor Limitations: NONE |
|
|
CheckForWin. Description: Checks for a win condition. If true, the function will set the m_winningPiece variable accordingly.
Implemented in CBGController, COthelloController, and CTicTacToeController. |
|
|
CheckMove. Description: Checks a move and returns true if it is valid and false otherwise.
Implemented in CBGController, COthelloController, and CTicTacToeController. |
|
|
IsUsingCaffeine. Description: Returns true if we are using the Caffeine framework.
|
|
|
NewGame. Description: Initalizes the game board and sets the m_curPiece value to the first player that should play.
Implemented in CBGController, COthelloController, and CTicTacToeController. |
|
|
Play. Description: Tells the GUI to play a move. This is needed so that we can pass stochastic elements to the game controller (eg dice rolls).
Implemented in CBGController, COthelloController, and CTicTacToeController. |
|
|
PlayMove. Description: Plays a move by updating the game board.
Implemented in CBGController, COthelloController, and CTicTacToeController. |
|
|
PostEvent. Description: Posts an event to the target widget.
|
|
|
run Description: The main function for this thread. It will process messages from the Caffeine Helper.
|
|
|
SetPlayerPiece. Description: This function is called when the player's piece should be set.
Implemented in CBGController, COthelloController, and CTicTacToeController. |
|
|
StartNewGame. Description: Starts a new game and posts the event to the GUI for the first player to move if not connecting to Caffeine Client.
|
|
|
Stop. Description: Stops this thread.
|
|
|
TimeElapsed. Description: Called when either a player's move time or game time has expired
Implemented in CBGController, COthelloController, and CTicTacToeController. |
|
|
UpdateCurrentPlayerPiece. Description: Updates the value of the m_curPiece variable to the piece that should play now.
Implemented in CBGController, COthelloController, and CTicTacToeController. |
|
|
UserMove. Description: Takes a move made by the user checks its validity and then plays the move if it is valid. It will also send the move along to the caffeine framework if needed.
|