Timer.hh

00001 /*
00002 ** TowBowlTactics, an adaptation of the tabletop game Blood Bowl.
00003 ** 
00004 ** Copyright (C) 2006 The TBT Team.
00005 ** 
00006 ** This program is free software; you can redistribute it and/or
00007 ** modify it under the terms of the GNU General Public License
00008 ** as published by the Free Software Foundation; either version 2
00009 ** of the License, or (at your option) any later version.
00010 ** 
00011 ** The complete GNU General Public Licence Notice can be found as the
00012 ** `NOTICE' file in the root directory.
00013 ** 
00014 ** The TBT Team consists of people listed in the `AUTHORS' file.
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 /* !TIMER_HH_ */

Generated on Sat Jun 23 16:07:24 2007 for Stechec/TBT by  doxygen 1.4.7