00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef TIMER_HH_
00018 # define TIMER_HH_
00019
00033 class Timer
00034 {
00035 public:
00036 Timer(int allowed_time);
00037 Timer();
00038 ~Timer();
00039
00042 void setAllowedTime(int allowed_time);
00044 int getAllowedTime() const;
00047 int getTimeRemaining() const;
00050 bool isTimeElapsed() const;
00053 bool isPaused() const;
00054
00056 void start();
00058 void stop();
00060 void restart();
00063 void pause();
00064
00065 private:
00066 bool started_;
00067 int begin_;
00068 int begin_pause_;
00069 int time_allowed_;
00070 };
00071
00072 #endif