00001 //---------------------------------------------------------------------------- 00002 /** @file SpSafePlayer.h 00003 Safe player */ 00004 //---------------------------------------------------------------------------- 00005 00006 #ifndef SP_SAFEPLAYER_H 00007 #define SP_SAFEPLAYER_H 00008 00009 #include "SpSimplePlayer.h" 00010 #include "SpMoveGenerator.h" 00011 00012 //---------------------------------------------------------------------------- 00013 00014 /** Uses GoSafetySolver and one ply search. 00015 Strong in the end, random in the beginning */ 00016 class SpSafeMoveGenerator 00017 : public Sp1PlyMoveGenerator 00018 { 00019 public: 00020 explicit SpSafeMoveGenerator(const GoBoard& board) 00021 : Sp1PlyMoveGenerator(board) 00022 { } 00023 00024 int Evaluate(); 00025 }; 00026 00027 //---------------------------------------------------------------------------- 00028 00029 /** Simple player using SpSafeMoveGenerator */ 00030 class SpSafePlayer 00031 : public SpSimplePlayer 00032 { 00033 public: 00034 SpSafePlayer(const GoBoard& board) 00035 : SpSimplePlayer(board, new SpSafeMoveGenerator(board)) 00036 { } 00037 00038 std::string Name() const 00039 { 00040 return "Safe"; 00041 } 00042 }; 00043 00044 //---------------------------------------------------------------------------- 00045 00046 #endif // SP_SAFEPLAYER_H 00047