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

COthelloController Class Reference

COthelloController. More...

#include <OthelloController.h>

Inheritance diagram for COthelloController:

CGUIController List of all members.

Public Slots

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

Public Member Functions

 COthelloController (QWidget *target)
 COthelloController.
 COthelloController (QWidget *target, uint32 studentID, const int8 *name, uint32 nameLength, CaffeineGUID gameID, bool bIsSpectator=false)
 COthelloController.
 ~COthelloController ()
 ~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.
bool HasMoves (COthelloPiece p) const
 HasMoves.
void SetPlayerPiece (const CPiece *p)
 SetPlayerPiece.
void TimeElapsed (const CPlayerPiece *piece)
 TimeElapsed.

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

COthelloController::COthelloController QWidget *  target  ) 
 

COthelloController.

Description: Class constructor

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

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

COthelloController.

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

COthelloController::~COthelloController void   ) 
 

~COthelloController

Description: Class deconstructor

Limitations: NONE


Member Function Documentation

bool COthelloController::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 COthelloController::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.

bool COthelloController::HasMoves COthelloPiece  p  )  const [protected]
 

HasMoves.

Description: Checks to see if the piece has any moves.

Parameters:
p is the piece to check for valid moves.
Returns:
Returns true if the piece has moves and false otherwise.
Limitations: NONE

void COthelloController::NewGame  )  [protected, virtual]
 

NewGame.

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

Returns:
void
Limitations: NONE

Implements CGUIController.

bool COthelloController::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 COthelloController::PieceTypeChanged uint32  x,
uint32  y,
COthelloPiece::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 COthelloController::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 COthelloController::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 COthelloController::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 COthelloController::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 COthelloController::UpdateCurrentPlayerPiece  )  [protected, virtual]
 

UpdateCurrentPlayerPiece.

Description:

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