UGDK
src/ugdk/time/timeaccumulator.h
Go to the documentation of this file.
00001 #ifndef UGDK_TIME_TIMEACCUMULATOR_H_
00002 #define UGDK_TIME_TIMEACCUMULATOR_H_
00003 
00004 #include <ugdk/time/timemanager.h>
00005 
00006 namespace ugdk {
00007 namespace time {
00008 
00009 class TimeAccumulator {
00010   public:
00011     // Construtores e destrutores
00012     TimeAccumulator(int duration_miliseconds);
00013     ~TimeAccumulator() { }
00014 
00015     // Ignora tempo pausado
00016     int TimeLeft();
00017 
00018     // True se o timer ja expirou
00019     bool Expired();
00020 
00021     // Despausa se pausado
00022     void Restart();
00023 
00024     // Despausa se pausado e ataliza a duracao
00025     void Restart(int duration_miliseconds);
00026 
00027     // Pausa o timer, desconsiderando o tempo ate que seja despausado
00028     void Pause();
00029 
00030     // Despausa o contador
00031     void Resume();
00032 
00033     // True se pausado. False caso contrario
00034     bool IsPaused();
00035 
00036   private:
00037     TimeManager *handler_;
00038     uint32 initial_time_, time_paused_, when_paused_, duration_;
00039 };
00040 
00041 }  // namespace time
00042 }  // namespace ugdk
00043 
00044 #endif  // HORUSEYE_FRAMEWORK_TIMEACCUMULATOR_H_
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines