Breakout
LTimer.h
Go to the documentation of this file.
1 #include <stdio.h>
2 #include <string>
3 #include <sstream>
4 #include <cstdint>
9 class LTimer
10 {
11 public:
15  LTimer();
16 
20  void start();
24  void stop();
28  void pause();
32  void unpause();
33 
37  uint32_t getTicks();
41  uint32_t getSDLTicks();
42 
46  bool isStarted();
50  bool isPaused();
51 
52 private:
56  uint32_t mStartTicks;
57 
61  uint32_t mPausedTicks;
62 
66  bool mPaused;
70  bool mStarted;
71 
72 
73 };
This class abstracts multiple timing related mechanism in the game.
Definition: LTimer.h:10
bool isStarted()
Method to check if the timer is started.
Definition: LTimer.cpp:95
void unpause()
Method to unpause the timer.
Definition: LTimer.cpp:55
void start()
Method to start the timer.
Definition: LTimer.cpp:15
uint32_t getSDLTicks()
Method to get the current SDL ticks.
Definition: LTimer.cpp:107
void pause()
Method to pause the timer.
Definition: LTimer.cpp:41
uint32_t getTicks()
Method to get the current ticks.
Definition: LTimer.cpp:71
LTimer()
The constructor of the class.
Definition: LTimer.cpp:5
bool isPaused()
Method to check if the timer is paused.
Definition: LTimer.cpp:101
void stop()
Method to stop the timer.
Definition: LTimer.cpp:28