Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

SpLadderPlayer.h

Go to the documentation of this file.
00001 //----------------------------------------------------------------------------
00002 /** @file SpLadderPlayer.h
00003     Ladder catcher player */
00004 //----------------------------------------------------------------------------
00005 
00006 #ifndef SP_LADDERPLAYER_H
00007 #define SP_LADDERPLAYER_H
00008 
00009 #include "SpSimplePlayer.h"
00010 #include "SpMoveGenerator.h"
00011 
00012 //----------------------------------------------------------------------------
00013 
00014 /** Generates ladder captures/escapes */
00015 class SpLadderMoveGenerator
00016     : public SpStaticMoveGenerator
00017 {
00018 public:
00019     explicit SpLadderMoveGenerator(const GoBoard& board)
00020         : SpStaticMoveGenerator(board)
00021     { }
00022 
00023     virtual void GenerateMoves(SgEvaluatedMoves& eval, SgBlackWhite toPlay);
00024     
00025     virtual int Score(SgPoint p);
00026 };
00027 
00028 //----------------------------------------------------------------------------
00029 
00030 /** Simple player using SpLadderMoveGenerator */
00031 class SpLadderPlayer
00032     : public SpSimplePlayer
00033 {
00034 public:
00035     SpLadderPlayer(const GoBoard& board)
00036         : SpSimplePlayer(board, new SpLadderMoveGenerator(board))
00037     { }
00038 
00039     std::string Name() const
00040     {
00041         return "Ladder";
00042     }
00043 };
00044 
00045 //----------------------------------------------------------------------------
00046 
00047 #endif
00048 


Sun Mar 13 2011 Doxygen 1.7.1