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

CBGBoard Class Reference

CBGBoard. More...

#include <BGBoard.h>

List of all members.

Public Member Functions

 CBGBoard ()
 CBGBoard.
 ~CBGBoard ()
 ~CBGBoard
void NewGame ()
 NewGame.
void PlayMove (const CBGMove *m)
 PlayMove.
bool CheckMove (const CBGMove *m)
 CheckMove.
bool VerifySingleMove (CBGPiece p, int32 start, int32 end, uint32 die) const
 VerifySingleMove.
bool CheckForWin ()
 CheckForWin.
void UpdateCurrentPlayerPiece ()
 UpdateCurrentPlayerPiece.

Protected Member Functions

void PlaySingleMove (CBGPiece p, int32 start, int32 end, bool bEmitSignals=false)
 PlaySingleMove.
bool HasValidMoves (CBGPlayerTurn player)
 HasValidMoves.
CBGPlayerTurn RollDice () const
 RollDice.
std::vector< CBGMoveGenerateMoves (uint32 die1, uint32 die2, CBGPiece p)
 GenerateMoves.


Detailed Description

CBGBoard.

Description: Represents a Backgammon game board.

Limitations: NONE


Constructor & Destructor Documentation

CBGBoard::CBGBoard  ) 
 

CBGBoard.

Description: Class constructor

Limitations: NONE

CBGBoard::~CBGBoard  ) 
 

~CBGBoard

Description: Class deconstructor

Limitations: NONE


Member Function Documentation

bool CBGBoard::CheckForWin  ) 
 

CheckForWin.

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

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

bool CBGBoard::CheckMove const CBGMove m  ) 
 

CheckMove.

Description: Checks a move and returns true if it is valid.

Parameters:
m is the move being checked.
Returns:
True if the move is valid and false otherwise.
Limitations: NONE

std::vector< CBGMove > CBGBoard::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

bool CBGBoard::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 CBGBoard::NewGame  ) 
 

NewGame.

Description: Resets the board to the beginning state.

Returns:
void
Limitations: NONE

void CBGBoard::PlayMove const CBGMove m  ) 
 

PlayMove.

Description: Updates the board based on a given move.

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

void CBGBoard::PlaySingleMove CBGPiece  p,
int32  start,
int32  end,
bool  bEmitSignals = false
[protected]
 

PlaySingleMove.

Description: Plays "half" a move.

Parameters:
 
Returns:
void
Limitations: must be valid

CBGPlayerTurn CBGBoard::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 CBGBoard::UpdateCurrentPlayerPiece  ) 
 

UpdateCurrentPlayerPiece.

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

Returns:
struct with next player to play
Limitations: NONE

bool CBGBoard::VerifySingleMove CBGPiece  p,
int32  start,
int32  end,
uint32  die
const
 

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