Game Develop C++ Platform: ManualTimer.h Source File

| Game Develop C++ Platform Platform for developing native games based on OpenGL and SFML with Game Develop

- Main Page
- Modules
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Groups Pages
ManualTimer.h
Go to the documentation of this file.
1
5 #ifndef MANUALTIMER_H
6 #define MANUALTIMER_H
7 #include <string>
8
16 class GD_API ManualTimer
17 {
18 public:
19
20 ManualTimer();
21
26 ManualTimer(std::string name_);
27
28 virtual ~ManualTimer();
29
34 inline std::string GetName() { return name; };
35
40 inline void UpdateTime(signed long long time_) { if (!isPaused) time += time_; };
41
45 inline void Reset() { time = 0; };
46
51 inline signed long long GetTime() const { return time; };
52
58 inline void SetTime(signed long long newTime) { time = newTime; };
59
64 inline bool IsPaused() const { return isPaused; };
65
70 inline void SetPaused(bool newState = true) { isPaused = newState; };
71
72 private:
73
74 std::string name;
75 signed long long time;
76 bool isPaused;
77 };
78
79 #endif // MANUALTIMER_H
80