00001 /* bookPlayer.h 00002 */ 00003 #ifndef GAME_PLAYING_BOOKPLAYER_H 00004 #define GAME_PLAYING_BOOKPLAYER_H 00005 00006 #include "osl/game_playing/computerPlayer.h" 00007 00008 namespace osl 00009 { 00010 namespace game_playing 00011 { 00012 class OpeningBookTracer; 00016 class BookPlayer 00017 : public ComputerPlayer, 00018 public ComputerPlayerSelectBestMoveInTime 00019 { 00020 boost::scoped_ptr<OpeningBookTracer> book; 00021 boost::scoped_ptr<ComputerPlayer> searcher; 00022 int book_limit; 00023 int current_moves; 00024 bool valid_initial_position; 00025 public: 00027 BookPlayer(OpeningBookTracer*, ComputerPlayer*); 00028 ~BookPlayer(); 00029 ComputerPlayer* clone() const; 00030 00032 void setBookLimit(int new_limit); 00033 00034 void setInitialState(const NumEffectState&); 00035 void pushMove(Move m); 00036 void popMove(); 00037 const MoveWithComment selectBestMove(const GameState&, int seconds, int elapsed, 00038 int byoyomi); 00039 const MoveWithComment selectBestMoveInTime(const GameState&, const search::TimeAssigned&); 00040 00041 bool bookAvailable() const; 00042 00043 // delegations ... 00044 void allowSpeculativeSearch(bool value); 00045 virtual bool stopSearchNow(); 00047 void setRootIgnoreMoves(const container::MoveVector *rim, bool prediction); 00048 private: 00049 const Move moveByBook(const GameState& state); 00050 }; 00051 00052 } // namespace game_playing 00053 } // namespace osl 00054 00055 00056 #endif /* GAME_PLAYING_BOOKPLAYER_H */ 00057 // ;;; Local Variables: 00058 // ;;; mode:c++ 00059 // ;;; c-basic-offset:2 00060 // ;;; End: