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

CBackgammonGM Class Reference

CBackgammonGM. More...

#include <BackgammonGM.h>

Inheritance diagram for CBackgammonGM:

CGameModule CPlayer CGenericTask List of all members.

Public Member Functions

 CBackgammonGM ()
 CBackgammonGM.
 ~CBackgammonGM ()
 ~CBackgammonGM
CEID GetCEID () const
 GetCEID.

Protected Member Functions

void NewGame ()
 NewGame.
void PlayMove (const CMove *m)
 PlayMove.
bool CheckMove (const CMove *m)
 CheckMove.
bool CheckForWin ()
 CheckForWin.
void InvalidMoveProcessing (const CMove *p)
 InvalidMoveProcessing.
void SetPlayerDescription ()
 VERSION CONTROL HISTORY
Revision
1.1
.
void UpdateCurrentPlayerPiece ()
 UpdateCurrentPlayerPiece.
void AddPlayer (CDescription desc)
 AddPlayer.
void RemovePlayer (CDescription desc)
 RemovePlayer.
void TimeElapsed (const CPlayerPiece *piece)
 TimeElapsed.
void PlaySingleMove (CBGPiece p, int32 start, int32 end)
 PlaySingleMove.
CBGPlayerTurn RollDice () const
 RollDice.
bool VerifySingleMove (CBGPiece p, int32 start, int32 end, uint32 die) const
 VerifySingleMove.
bool HasValidMoves (CBGPlayerTurn player)
 HasValidMoves.
std::vector< CBGMoveGenerateMoves (uint32 die1, uint32 die2, CBGPiece p)
 GenerateMoves.

Detailed Description

CBackgammonGM.

Description: The Backgammon Game Module. It will check that moves are valid.

Limitations: NONE


Constructor & Destructor Documentation

CBackgammonGM::CBackgammonGM  ) 
 

CBackgammonGM.

Description: Class constructor

Returns:
void
Limitations: NONE

CBackgammonGM::~CBackgammonGM  ) 
 

~CBackgammonGM

Description: Class deconstructor

Returns:
void
Limitations: NONE


Member Function Documentation

void CBackgammonGM::AddPlayer CDescription  desc  )  [protected, virtual]
 

AddPlayer.

Description: Adds a new player to the game.

Parameters:
desc is the description of the new player
Returns:
void
Limitations: NONE

Implements CGameModule.

bool CBackgammonGM::CheckForWin  )  [protected, virtual]
 

CheckForWin.

Description: This function is called to check for win states.

Returns:
true if the game is won.
Limitations: NONE

Implements CGameModule.

bool CBackgammonGM::CheckMove const CMove pMove  )  [protected, virtual]
 

CheckMove.

Description: This function is called to verify a move is valid.

Parameters:
m is the move to check.
Returns:
true if move is valid.
Limitations: NONE

Implements CGameModule.

std::vector< CBGMove > CBackgammonGM::GenerateMoves uint32  die1,
uint32  die2,
CBGPiece  p
[protected]
 

GenerateMoves.

Description: Returns a character representing the piece.

Parameters:
p the piece to get the character for
Returns:
The character representing the piece
Limitations: NONE

CEID CBackgammonGM::GetCEID  )  const [virtual]
 

GetCEID.

Description: Returns the CEID of this game module

Returns:
The CEID of this game module
Limitations: NONE

Implements CGameModule.

bool CBackgammonGM::HasValidMoves CBGPlayerTurn  player  )  [protected]
 

HasValidMoves.

Description: This function is called to check if a player has any valid moves.

Returns:
true if the player has at least one valid move.
Limitations: NONE

void CBackgammonGM::InvalidMoveProcessing const CMove p  )  [protected, virtual]
 

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.

Parameters:
p is the invalid move.
Returns:
void
Limitations: NONE

Implements CGameModule.

void CBackgammonGM::NewGame  )  [protected, virtual]
 

NewGame.

Description: Initalizes the game board and sets the m_curPiece value to the first player that should play.

Returns:
void
Limitations: NONE

Implements CGameModule.

void CBackgammonGM::PlayMove const CMove pMove  )  [protected, virtual]
 

PlayMove.

Description: Plays a move.

Parameters:
m is the move to play.
Returns:
void
Limitations: m must be valid move.

Implements CGameModule.

void CBackgammonGM::PlaySingleMove CBGPiece  p,
int32  start,
int32  end
[protected]
 

PlaySingleMove.

Description: Plays "half" a move.

Parameters:
 
Returns:
void
Limitations: must be valid

void CBackgammonGM::RemovePlayer CDescription  desc  )  [protected, virtual]
 

RemovePlayer.

Description: Removes a player from the game.

Parameters:
desc is the description of the player to remove.
Returns:
void
Limitations: m must be valid move.

Implements CGameModule.

CBGPlayerTurn CBackgammonGM::RollDice  )  const [protected]
 

RollDice.

Description: This function is generate random numbers for the dice roll

Returns:
struct containing the values of the dice rolled
Limitations: NONE

void CBackgammonGM::SetPlayerDescription  )  [inline, protected, virtual]
 

VERSION CONTROL HISTORY

Revision
1.1
.

Log
BackgammonGM.hpp,v
Revision 1.1 2005/06/12 18:21:46 mabruns Initial Import

Revision 1.1 2005/05/12 15:59:18 tcsvw5 BackgammonGM.hpp

Revision 1.2 2005/04/16 22:28:21 mab6d5 Updated for new GM base class

Revision 1.1 2005/04/05 04:44:36 tcsvw5 empty log message ***

Revision 1.1 2005/03/20 23:48:50 tcsvw5 Initial revison

Revision 1.0 2005/02/03 20:39:04 cafene Added CVS expansion keywords to the template.

Reimplemented from CGameModule.

void CBackgammonGM::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 CGameModule.

void CBackgammonGM::UpdateCurrentPlayerPiece  )  [protected, virtual]
 

UpdateCurrentPlayerPiece.

Description: This function is called get the next player to play

Returns:
struct with next player to play
Limitations: NONE

Implements CGameModule.

bool CBackgammonGM::VerifySingleMove CBGPiece  p,
int32  start,
int32  end,
uint32  die
const [protected]
 

VerifySingleMove.

Description: This function is called to verify "half" a move is valid.

Parameters:
p - Piece of the player start - starting point end - ending point die - number of the die roll
Returns:
true if move is valid.
Limitations: NONE


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