Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

SpSimplePlayer.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 /** @file SpSimplePlayer.h
00003     Base class for simple Go playing algorithms.
00004 */
00005 //----------------------------------------------------------------------------
00006 
00007 #ifndef SP_SIMPLEPLAYER_H
00008 #define SP_SIMPLEPLAYER_H
00009 
00010 #include "GoBoard.h"
00011 #include "GoPlayer.h"
00012 
00013 class SgTimeRecord;
00014 class SpMoveGenerator;
00015 class SpRandomMoveGenerator;
00016 
00017 //----------------------------------------------------------------------------
00018 
00019 /** SimplePlayer has one move generator. 
00020     It generates random moves if no other move is found.
00021 */
00022 class SpSimplePlayer
00023     : public GoPlayer
00024 {
00025 public:
00026     virtual ~SpSimplePlayer();
00027 
00028     SgPoint GenMove(const SgTimeRecord& time, SgBlackWhite toPlay);
00029 
00030     virtual int MoveValue(SgPoint p);
00031 
00032 protected:
00033     SpSimplePlayer(GoBoard& board, SpMoveGenerator* generator);
00034             
00035 private:
00036     /** Move generator */
00037     SpMoveGenerator* m_generator;
00038 
00039     /** Use random generator if no other move found */
00040     SpRandomMoveGenerator* m_randomGenerator;
00041 
00042     /** Don't play on safe points */
00043     virtual bool UseFilter() const 
00044     {
00045         return true;
00046     }    
00047 };
00048 
00049 //----------------------------------------------------------------------------
00050 
00051 #endif // SP_SIMPLEPLAYER_H
00052 


17 Jun 2010 Doxygen 1.4.7