All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
computerPlayer.h
Go to the documentation of this file.
1 /* computerPlayer.h
2  */
3 #ifndef GAME_PLAYING_COMPUTERPLAYER_H
4 #define GAME_PLAYING_COMPUTERPLAYER_H
5 
8 #include "osl/move.h"
9 #include "osl/misc/carray.h"
10 #include <boost/scoped_ptr.hpp>
11 namespace osl
12 {
13  namespace container
14  {
15  class MoveVector;
16  }
17  namespace search
18  {
19  struct TimeAssigned;
20  }
21  namespace game_playing
22  {
23  class GameState;
25  {
26  protected:
28  public:
30  {
31  }
32  virtual ~ComputerPlayer();
34  virtual ComputerPlayer* clone() const = 0;
35 
36  virtual void pushMove(Move m)=0;
37  virtual void popMove()=0;
39  virtual bool isReasonableMove(const GameState&,
40  Move move, int pawn_sacrifice);
44  virtual const MoveWithComment selectBestMove(const GameState&, int seconds, int elapsed,
45  int byoyomi)=0;
46 
47  virtual void setInitialState(const NumEffectState&);
51  virtual void allowSpeculativeSearch(bool value);
53  virtual bool stopSearchNow();
54 
55  virtual void setRootIgnoreMoves(const container::MoveVector *rim, bool prediction);
56  };
57 
59  {
60  public:
62  virtual const MoveWithComment selectBestMoveInTime(const GameState&, const search::TimeAssigned&)=0;
63  };
68  {
69  public:
70  ~ResignPlayer();
72  {
73  return new ResignPlayer();
74  }
75  void pushMove(Move m);
76  void popMove();
77  const MoveWithComment selectBestMove(const GameState&, int, int, int);
78  };
79 
84  {
85  public:
87  {
88  return new RandomPlayer();
89  }
90  ~RandomPlayer();
91  void pushMove(Move m);
92  void popMove();
93  const MoveWithComment selectBestMove(const GameState&, int, int, int);
94  };
95 
96  } // namespace game_playing
97 } // namespace osl
98 
99 #endif /* GAME_PLAYING_COMPUTERPLAYER_H */
100 // ;;; Local Variables:
101 // ;;; mode:c++
102 // ;;; c-basic-offset:2
103 // ;;; End: