All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
timeKeeper.h
Go to the documentation of this file.
1 /* timeKeeper.h
2  */
3 #ifndef GAME_PLAYING_TIMEKEEPER_H
4 #define GAME_PLAYING_TIMEKEEPER_H
5 
6 #include "osl/player.h"
7 #include <boost/scoped_ptr.hpp>
8 namespace osl
9 {
10  namespace game_playing
11  {
12  class TimeKeeper
13  {
14  struct Stack;
15  boost::scoped_ptr<Stack> seconds;
16  public:
17  TimeKeeper();
18  TimeKeeper(int black_time, int white_time);
19  ~TimeKeeper();
20 
21  void reset(int black_time, int white_time);
22 
23  void pushMove(Player, int seconds);
24  void popMove();
25  int timeLeft(Player) const;
26  int timeElapsed(Player) const;
27  int timeLimit(Player) const;
28  };
29  } // namespace game_playing
30 } // namespace osl
31 
32 #endif /* GAME_PLAYING_TIMEKEEPER_H */
33 // ;;; Local Variables:
34 // ;;; mode:c++
35 // ;;; c-basic-offset:2
36 // ;;; End: