00001 /* computerPlayer.h 00002 */ 00003 #ifndef GAME_PLAYING_COMPUTERPLAYER_H 00004 #define GAME_PLAYING_COMPUTERPLAYER_H 00005 00006 #include "osl/game_playing/moveWithComment.h" 00007 #include "osl/move.h" 00008 #include "osl/misc/carray.h" 00009 #include <boost/scoped_ptr.hpp> 00010 namespace osl 00011 { 00012 namespace game_playing 00013 { 00014 class GameState; 00015 class ComputerPlayer 00016 { 00017 protected: 00018 bool speculative_search_allowed; 00019 public: 00020 ComputerPlayer() : speculative_search_allowed(false) 00021 { 00022 } 00023 virtual ~ComputerPlayer(); 00025 virtual ComputerPlayer* clone() const = 0; 00026 00027 virtual void pushMove(Move m)=0; 00028 virtual void popMove()=0; 00030 virtual bool isReasonableMove(const GameState&, 00031 Move move, int pawn_sacrifice); 00035 virtual const MoveWithComment selectBestMove(const GameState&, int seconds, 00036 int byoyomi)=0; 00037 00041 virtual void allowSpeculativeSearch(bool value); 00042 }; 00043 00047 class ResignPlayer : public ComputerPlayer 00048 { 00049 public: 00050 ~ResignPlayer(); 00051 ComputerPlayer* clone() const 00052 { 00053 return new ResignPlayer(); 00054 } 00055 void pushMove(Move m); 00056 void popMove(); 00057 const MoveWithComment selectBestMove(const GameState&, int, int); 00058 }; 00059 00063 class RandomPlayer : public ComputerPlayer 00064 { 00065 public: 00066 ComputerPlayer* clone() const 00067 { 00068 return new RandomPlayer(); 00069 } 00070 ~RandomPlayer(); 00071 void pushMove(Move m); 00072 void popMove(); 00073 const MoveWithComment selectBestMove(const GameState&, int, int); 00074 }; 00075 00076 } // namespace game_playing 00077 } // namespace osl 00078 00079 #endif /* GAME_PLAYING_COMPUTERPLAYER_H */ 00080 // ;;; Local Variables: 00081 // ;;; mode:c++ 00082 // ;;; c-basic-offset:2 00083 // ;;; End: