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

CBackgammonAI Class Reference

CBackgammonAI. More...

#include <BackgammonAI.h>

Inheritance diagram for CBackgammonAI:

CAIModule CLocalPlayer CPlayer CGenericTask List of all members.

Public Member Functions

 CBackgammonAI ()
 CBackgammonAI.
 ~CBackgammonAI ()
 ~CBackgammonAI

Protected Member Functions

void NewGame ()
 NewGame.
void Play (const CPiece *p)
 Play.
void PlayMove (const CMove *m)
 DoMove.
bool CheckMove (const CMove *m)
 CheckMove.
void InvalidMoveProcessing (const CMove *p)
 InvalidMoveProcessing.
void SetPlayerDescription ()
 SetPlayerDescription.
void SetPlayerPiece (const CPiece *p)
 SetPlayerPiece.
void PlaySingleMove (CBGPiece p, int32 start, int32 end)
 PlaySingleMove.
void UndoLastMove ()
 UndoLastMove.
vector< CBGMoveGenerateMoves (uint32 die1, uint32 die2)
 GenerateMoves.
CBGMove ABDLM (int32 a, int32 b, int8 d, uint8 die1, uint8 die2, bool lastWasDoubles)
 ABDLM.
int32 ABMax (int32 a, int32 b, int8 d, uint8 die1, uint8 die2, bool lastWasDoubles)
 ABMax.
int32 ExpectiABMax (int32 a, int32 b, int8 d)
 ExpectiABMax.
int32 ABMin (int32 a, int32 b, int8 d, uint8 die1, uint8 die2, bool lastWasDoubles)
 ABMin.
int32 ExpectiABMin (int32 a, int32 b, int8 d)
 ExpectiABMin.
bool VerifySingleMove (CBGPiece p, int32 start, int32 end, uint32 die) const
 VerifySingleMove.
int32 Evaluate ()
 Evaluate.

Detailed Description

CBackgammonAI.

Description: AI player for Backgammon

Limitations: NONE


Constructor & Destructor Documentation

CBackgammonAI::CBackgammonAI  ) 
 

CBackgammonAI.

Description: Creates a new instance of CBackgammonAI

Parameters:
NONE 
Returns:
void
Limitations: NONE

CBackgammonAI::~CBackgammonAI  ) 
 

~CBackgammonAI

Description: Destructor

Parameters:
NONE 
Returns:
void
Limitations: NONE


Member Function Documentation

CBGMove CBackgammonAI::ABDLM int32  a,
int32  b,
int8  d,
uint8  die1,
uint8  die2,
bool  lastWasDoubles
[protected]
 

ABDLM.

Description: Preforms an Alpha Beta MiniMax search on the current position

Parameters:
NONE 
Returns:
MOVE
Limitations: NONE

int32 CBackgammonAI::ABMax int32  a,
int32  b,
int8  d,
uint8  die1,
uint8  die2,
bool  lastWasDoubles
[protected]
 

ABMax.

Description:

Parameters:
NONE 
Returns:
void
Limitations: NONE

int32 CBackgammonAI::ABMin int32  a,
int32  b,
int8  d,
uint8  die1,
uint8  die2,
bool  lastWasDoubles
[protected]
 

ABMin.

Description:

Parameters:
NONE 
Returns:
void
Limitations: NONE

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

CheckMove.

Description: Returns true if the MOVE pMove is valid

Parameters:
pMove the move to be played
Returns:
bool
Limitations: NONE

Implements CAIModule.

int32 CBackgammonAI::Evaluate  )  [protected]
 

Evaluate.

Description:

Parameters:
 
Returns:
Limitations:

int32 CBackgammonAI::ExpectiABMax int32  a,
int32  b,
int8  d
[protected]
 

ExpectiABMax.

Description: Expected Max value

Parameters:
 
Returns:
Limitations: NONE

int32 CBackgammonAI::ExpectiABMin int32  a,
int32  b,
int8  d
[protected]
 

ExpectiABMin.

Description: Expected Min value

Parameters:
 
Returns:
Limitations: NONE

std::vector< CBGMove > CBackgammonAI::GenerateMoves uint32  die1,
uint32  die2
[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

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

InvalidMoveProcessing.

Description: Called when an invalid move was discovered.

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

Implements CAIModule.

void CBackgammonAI::NewGame  )  [protected, virtual]
 

NewGame.

Description: Initalizes the game board

Returns:
void
Limitations: NONE

Implements CAIModule.

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

Play.

Description: Generates the move to play

Parameters:
NONE 
Returns:
MOVE to be played
Limitations: NONE

Implements CAIModule.

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

DoMove.

Description: Applies the move pMove

Parameters:
 
Returns:
void
Limitations: pMove must be a valid move.

Implements CAIModule.

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

PlaySingleMove.

Description: Plays "half" a move.

Parameters:
 
Returns:
void
Limitations: must be valid

void CBackgammonAI::SetPlayerDescription  )  [protected, virtual]
 

SetPlayerDescription.

Description: Sets the m_PlayerInfo variable with the correct data.

Returns:
void
Limitations: NONE

Reimplemented from CAIModule.

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

SetPlayerPiece.

Description: Sets the piece for this particular player

Parameters:
p the piece that this player will be using
Returns:
void
Limitations: NONE

Implements CAIModule.

void CBackgammonAI::UndoLastMove  )  [protected]
 

UndoLastMove.

Description: Undoes the last move played

Parameters:
NONE 
Returns:
void
Limitations: At least one previous move must have been played

bool CBackgammonAI::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