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