00001 //---------------------------------------------------------------------------- 00002 /** @file SpLibertyPlayer.h 00003 Liberty player, concentrates on low liberty stones 00004 */ 00005 //---------------------------------------------------------------------------- 00006 00007 #ifndef SP_LIBERTYPLAYER_H 00008 #define SP_LIBERTYPLAYER_H 00009 00010 #include "SpSimplePlayer.h" 00011 #include "SpMoveGenerator.h" 00012 00013 //---------------------------------------------------------------------------- 00014 00015 /** Tries to capture and escape with low liberty stones 00016 Blocks with few liberties are very important to this player 00017 */ 00018 class SpLibertyMoveGenerator 00019 : public SpStaticMoveGenerator 00020 { 00021 public: 00022 SpLibertyMoveGenerator(GoBoard& board) 00023 : SpStaticMoveGenerator(board) 00024 { } 00025 00026 int Score(SgPoint p); 00027 }; 00028 00029 //---------------------------------------------------------------------------- 00030 00031 /** Simple player using SpLibertyMoveGenerator */ 00032 class SpLibertyPlayer 00033 : public SpSimplePlayer 00034 { 00035 public: 00036 SpLibertyPlayer(GoBoard& board) 00037 : SpSimplePlayer(board, new SpLibertyMoveGenerator(board)) 00038 { } 00039 00040 std::string Name() const 00041 { 00042 return "Liberty"; 00043 } 00044 }; 00045 00046 //---------------------------------------------------------------------------- 00047 00048 int LibertyMinus2(const GoBoard& board, SgBlackWhite color); 00049 00050 #endif 00051