Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CTicTacToeController Class Reference

COthelloController. More...

#include <TicTacToeController.h>

Inheritance diagram for CTicTacToeController:

CGUIController List of all members.

Public Slots

bool PieceClicked (uint32, uint32)
 PieceClicked.
void PieceTypeChanged (uint32, uint32, CTicTacToePiece::TYPE)
 PieceTypeChanged.

Public Member Functions

 CTicTacToeController (QWidget *target)
 CTicTacToeController.
 CTicTacToeController (QWidget *target, uint32 studentID, const int8 *name, uint32 nameLength, CaffeineGUID gameID, bool bIsSpectator=false)
 CTicTacToeController.
 ~CTicTacToeController ()
 ~COthelloController

Protected Member Functions

void NewGame ()
 NewGame.
void Play (const CPiece *)
 Play.
void PlayMove (const CMove *m)
 PlayMove.
bool CheckMove (CMove *m)
 CheckMove.
bool CheckForWin ()
 CheckForWin.
void UpdateCurrentPlayerPiece ()
 UpdateCurrentPlayerPiece.
void SetPlayerPiece (const CPiece *p)
 SetPlayerPiece.
void TimeElapsed (const CPlayerPiece *piece)
 TimeElapsed.
bool CheckForPieceWin (CTicTacToePiece p) const
 CheckForPieceWin.

Detailed Description

COthelloController.

Description: This class is the controller class for the Othello GUI. It verifies moves and choses the the next player's turn. It will also communicate with the Caffeine Client if doing a AI/Tournament game.

Limitations: NONE


Constructor & Destructor Documentation

CTicTacToeController::CTicTacToeController QWidget *  target  ) 
 

CTicTacToeController.

Description: Class constructor

Parameters:
target is the QWidget target for the custom event messages.
Returns:
void
Limitations: NONE

CTicTacToeController::CTicTacToeController QWidget *  target,
uint32  studentID,
const int8 *  name,
uint32  nameLength,
CaffeineGUID  gameID,
bool  bIsSpectator = false
 

CTicTacToeController.

Description: Class constructor

Parameters:
target is the QWidget target for the custom event messages.
studentID is the student ID of the person playing.
name is the name of the person playing as a ascii string.
nameLength is the length in bytes of the name string
gameID is the CaffeineGUID of the game that we are playing.
bIsSpectator is true if this GUI is to be a spectator.
Returns:
void
Limitations: NONE

CTicTacToeController::~CTicTacToeController void   ) 
 

~COthelloController

Description: Class deconstructor

Limitations: NONE


Member Function Documentation

bool CTicTacToeController::CheckForPieceWin CTicTacToePiece  p  )  const [protected]
 

CheckForPieceWin.

Description: Checks to see if a certain piece is a winner.

Parameters:
p is the piece to check to see if it is the winner.
Returns:
void
Limitations: NONE

bool CTicTacToeController::CheckForWin  )  [protected, virtual]
 

CheckForWin.

Description: Checks for a win state and sets the m_winningPiece variable if in a win state.

Returns:
Return true if the game is in a end state and false otherwise.
Limitations: NONE

Implements CGUIController.

bool CTicTacToeController::CheckMove CMove m  )  [protected, virtual]
 

CheckMove.

Description: Validates a given move. Returns true if the move is valid and false otherwise.

Parameters:
m is the move to validate.
Returns:
Return true if the move is valid and false otherwise.
Limitations: NONE

Implements CGUIController.

void CTicTacToeController::NewGame  )  [protected, virtual]
 

NewGame.

Description: Resets all the board pieces to their default values.

Returns:
void
Limitations: NONE

Implements CGUIController.

bool CTicTacToeController::PieceClicked uint32  x,
uint32  y
[slot]
 

PieceClicked.

Description: Creates a move based on the square clicked by the user and tries to play the move.

Returns:
Return true if the move was valid and false otherwise.
Limitations: NONE

void CTicTacToeController::PieceTypeChanged uint32  x,
uint32  y,
CTicTacToePiece::TYPE  type
[slot]
 

PieceTypeChanged.

Description: Function called when a piece on the board changes type. Sends the update to the GUI.

Parameters:
x is the x-coordinate of the piece.
y is the y-coordinate of the piece.
type is the new type of the piece.
Returns:
void
Limitations: NONE

void CTicTacToeController::Play const CPiece  )  [inline, protected, virtual]
 

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).

Parameters:
p is piece information (eg dice rolls)
Returns:
void
Limitations: NONE

Implements CGUIController.

void CTicTacToeController::PlayMove const CMove m  )  [protected, virtual]
 

PlayMove.

Description: Plays a given move.

Parameters:
m is the move to play.
Returns:
void
Limitations: NONE

Implements CGUIController.

void CTicTacToeController::SetPlayerPiece const CPiece p  )  [protected, virtual]
 

SetPlayerPiece.

Description: Sets the player piece.

Parameters:
p is the piece to set.
Returns:
void
Limitations: NONE

Implements CGUIController.

void CTicTacToeController::TimeElapsed const CPlayerPiece piece  )  [protected, virtual]
 

TimeElapsed.

Description: Called when either a player's move time or game time has expired

Parameters:
piece is the CPlayerPiece* of the player whose time has expired
Returns:
void
Limitations: NONE

Implements CGUIController.

void CTicTacToeController::UpdateCurrentPlayerPiece  )  [protected, virtual]
 

UpdateCurrentPlayerPiece.

Description: Updates the m_curPiece variable with the next person to move.

Returns:
The piece of the next player to play or EMPTY if neither can make a move.
Limitations: NONE

Implements CGUIController.


The documentation for this class was generated from the following files:
Copyright (c) 2005 Matt Bruns, Pat Hammond, Kevin Markussen, Travis Service, Brain Shaver

SourceForge.net Logo