00001 //---------------------------------------------------------------------------- 00002 /** @file SpCapturePlayer.h 00003 Simple player that captures whenever possible, otherwise plays randomly */ 00004 //---------------------------------------------------------------------------- 00005 00006 #ifndef SP_CAPTUREPLAYER_H 00007 #define SP_CAPTUREPLAYER_H 00008 00009 #include "SpSimplePlayer.h" 00010 #include "SpMoveGenerator.h" 00011 00012 //---------------------------------------------------------------------------- 00013 00014 /** Simple player that captures whenever possible, otherwise plays randomly */ 00015 class SpCaptureMoveGenerator 00016 : public Sp1PlyMoveGenerator 00017 { 00018 public: 00019 explicit SpCaptureMoveGenerator(const GoBoard& board) 00020 : Sp1PlyMoveGenerator(board) 00021 { } 00022 00023 int Evaluate(); 00024 }; 00025 00026 //---------------------------------------------------------------------------- 00027 00028 /** Simple player using SpCaptureMoveGenerator */ 00029 class SpCapturePlayer 00030 : public SpSimplePlayer 00031 { 00032 public: 00033 SpCapturePlayer(const GoBoard& board) 00034 : SpSimplePlayer(board, new SpCaptureMoveGenerator(board)) 00035 { } 00036 00037 std::string Name() const 00038 { 00039 return "Capture"; 00040 } 00041 }; 00042 00043 //---------------------------------------------------------------------------- 00044 00045 #endif // SP_CAPTUREPLAYER_H 00046