Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

SpSimplePlayer Class Reference

#include <SpSimplePlayer.h>

Inheritance diagram for SpSimplePlayer:

Inheritance graph
[legend]
List of all members.

Detailed Description

SimplePlayer has one move generator.

It generates random moves if no other move is found.

Definition at line 22 of file SpSimplePlayer.h.

Public Member Functions

virtual ~SpSimplePlayer ()
SgPoint GenMove (const SgTimeRecord &time, SgBlackWhite toPlay)
virtual int MoveValue (SgPoint p)
GoBoardBoard ()
const GoBoardBoard () const
virtual std::string Name () const
SgNodeCurrentNode () const
void SetCurrentNode (SgNode *node)
virtual void OnGameFinished ()
virtual void OnNewGame ()
virtual void Ponder ()
int Variant () const
void SetVariant (int variant)
void SetSubscriber (GoBoard &subscriber)
void UpdateSubscriber ()

Protected Member Functions

 SpSimplePlayer (GoBoard &board, SpMoveGenerator *generator)
virtual void OnBoardChange ()
virtual void PrePlay (GoPlayerMove move)
virtual void OnPlay (GoPlayerMove move)
virtual void PreUndo ()
virtual void OnUndo ()

Protected Attributes

SgNodem_currentNode

Private Member Functions

virtual bool UseFilter () const
 Don't play on safe points.

Private Attributes

SpMoveGeneratorm_generator
 Move generator.
SpRandomMoveGeneratorm_randomGenerator
 Use random generator if no other move found.


Constructor & Destructor Documentation

SpSimplePlayer::~SpSimplePlayer (  )  [virtual]

Definition at line 33 of file SpSimplePlayer.cpp.

References m_generator, m_randomGenerator, and SG_ASSERT.

SpSimplePlayer::SpSimplePlayer ( GoBoard board,
SpMoveGenerator generator 
) [protected]

Definition at line 26 of file SpSimplePlayer.cpp.


Member Function Documentation

SgPoint SpSimplePlayer::GenMove ( const SgTimeRecord time,
SgBlackWhite  toPlay 
) [virtual]

Implements GoPlayer.

Definition at line 61 of file SpSimplePlayer.cpp.

References SgEvaluatedMovesArray::BestMove(), GoPlayer::Board(), SpMoveGenerator::GenerateMoves(), SpUtil::GetRelevantMoves(), m_generator, m_randomGenerator, SG_PASS, SG_UNUSED(), and UseFilter().

int SpSimplePlayer::MoveValue ( SgPoint  p  )  [virtual]

Reimplemented from GoPlayer.

Definition at line 43 of file SpSimplePlayer.cpp.

References GoBoard::AllEmpty(), GoPlayer::Board(), SpMoveGenerator::EvaluateMove(), GoSafetySolver::FindSafePoints(), m_generator, SG_BLACK, SG_WHITE, and UseFilter().

virtual bool SpSimplePlayer::UseFilter (  )  const [private, virtual]

Don't play on safe points.

Reimplemented in SpAveragePlayer, SpMinLibPlayer, and SpRandomPlayer.

Definition at line 43 of file SpSimplePlayer.h.

Referenced by GenMove(), and MoveValue().


Member Data Documentation

SpMoveGenerator* SpSimplePlayer::m_generator [private]

Move generator.

Definition at line 37 of file SpSimplePlayer.h.

Referenced by GenMove(), MoveValue(), and ~SpSimplePlayer().

SpRandomMoveGenerator* SpSimplePlayer::m_randomGenerator [private]

Use random generator if no other move found.

Definition at line 40 of file SpSimplePlayer.h.

Referenced by GenMove(), and ~SpSimplePlayer().


The documentation for this class was generated from the following files:


17 Jun 2010 Doxygen 1.4.7