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

CBGController Class Reference

communicate with the Caffeine Client if doing a AI/Tournament game. More...

#include <BGController.h>

Inheritance diagram for CBGController:

CGUIController List of all members.

Public Slots

bool TriangleClicked (int32)
 TriangleClicked.
void TriangleAddPiece (int32, CBGPiece::COLOR)
 TriangleAddPiece.
void TriangleRemovePiece (int32, CBGPiece::COLOR)
 TriangleRemovePiece.

Public Member Functions

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

Protected Member Functions

void NewGame ()
 NewGame.
void Play (const CPiece *p)
 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.

Detailed Description

communicate with the Caffeine Client if doing a AI/Tournament game.

Limitations: NONE


Constructor & Destructor Documentation

CBGController::CBGController QWidget *  target  ) 
 

CBGController.

Description: Class constructor

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

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

CBGController.

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

CBGController::~CBGController void   ) 
 

~CBGController

Description: Class deconstructor

Limitations: NONE


Member Function Documentation

bool CBGController::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 CBGController::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 CBGController::NewGame  )  [protected, virtual]
 

NewGame.

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

Returns:
void
Limitations: NONE

Implements CGUIController.

void CBGController::Play const CPiece p  )  [protected, virtual]
 

Play.

Description: Called when its our turn to play. Save the dice values and set the player piece dice values.

Parameters:
p is the CBGPlayerTurn containing the current roll.
Returns:
void
Limitations: NONE

Implements CGUIController.

void CBGController::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 CBGController::ResetMove  ) 
 

ResetMove.

Description: Resets the user move values so that they can start their move selection over.

Returns:
void
Limitations: NONE

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

SetPlayerPiece.

Description: Sets out player piece.

Parameters:
p is the CBGPlayerTurn variable that contains our piece color.
Returns:
void
Limitations: NONE

Implements CGUIController.

void CBGController::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 CBGController::TriangleAddPiece int32  num,
CBGPiece::COLOR  color
[slot]
 

TriangleAddPiece.

Description: Function called when a piece should be added to a triangle.

Parameters:
num is the location of the triangle in which to add the piece.
color is the color of the piece to add.
Returns:
void
Limitations: NONE

bool CBGController::TriangleClicked int32  num  )  [slot]
 

TriangleClicked.

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

Returns:
Return true if the the triangle should be highlight and false if the triangle should not be highlighted.
Limitations: NONE

void CBGController::TriangleRemovePiece int32  num,
CBGPiece::COLOR  color
[slot]
 

TriangleRemovePiece.

Description: Function called when a piece should be removed from a triangle.

Parameters:
num is the location of the triangle in which to remove the piece.
color is the color of the piece to remove.
Returns:
void
Limitations: NONE

void CBGController::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