-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTimer.h
90 lines (83 loc) · 5.91 KB
/
Timer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#ifndef TIMER_H
#define TIMER_H
/// @file Timer.h
/// @brief A Timer class, that keeps the time, and changes the framerate
#include "SDL2/SDL.h"
/// \author Moira Shooter
/// \version
/// \date Last Revision 16 MAY 2017
/// \class Timer
/// \brief This creates a timer, and calculates the elapsed time and has its set and get methos
/// \todo there is a problem with the timer (for different systems)
class Timer
{
public:
//--------------------------------------------------------------------------------------------------------------------
/// @brief the default constructor for timer
//--------------------------------------------------------------------------------------------------------------------
Timer();
//--------------------------------------------------------------------------------------------------------------------
/// @brief the default destructor for the timer
//--------------------------------------------------------------------------------------------------------------------
~Timer(){;}
//--------------------------------------------------------------------------------------------------------------------
/// @brief accessor function that access the elapsed time for the camera animation
//--------------------------------------------------------------------------------------------------------------------
float CameraTime() const;
//--------------------------------------------------------------------------------------------------------------------
/// @brief accessor function that access the elapsed time for the particle system animation
//--------------------------------------------------------------------------------------------------------------------
float DeltaTime() const;
//--------------------------------------------------------------------------------------------------------------------
/// @brief accessor function that acces the slowmotion time fort he particle system animation
//--------------------------------------------------------------------------------------------------------------------
float getSlowMow() const;
//--------------------------------------------------------------------------------------------------------------------
/// @brief accessor function that access if the timer is paused or not
//--------------------------------------------------------------------------------------------------------------------
bool getPause() const;
//--------------------------------------------------------------------------------------------------------------------
/// @brief mutator function that sets the timer when the animation end particle system
/// @param[in] _endTime the time when the updating is finished
//--------------------------------------------------------------------------------------------------------------------
void setEndTime(float _endTime);
//--------------------------------------------------------------------------------------------------------------------
/// @brief mutator function that sets the delta time (endTime-startTime)
/// @param[in] _deltaTime the time difference of the finished timer and the start timer
//--------------------------------------------------------------------------------------------------------------------
void setDeltaTime(float _deltaTime);
//--------------------------------------------------------------------------------------------------------------------
/// @brief function that pauses the time
//--------------------------------------------------------------------------------------------------------------------
void pauseTimer();
//--------------------------------------------------------------------------------------------------------------------
/// @brief function that unpause the time
//--------------------------------------------------------------------------------------------------------------------
void unPauseTimer();
private:
//--------------------------------------------------------------------------------------------------------------------
/// @brief the value when the timer starts
//--------------------------------------------------------------------------------------------------------------------
float m_startTime;
//--------------------------------------------------------------------------------------------------------------------
/// @brief the value when the timer ends
//--------------------------------------------------------------------------------------------------------------------
float m_endTime;
//--------------------------------------------------------------------------------------------------------------------
/// @brief the elapsed time for the animation of the camera
//--------------------------------------------------------------------------------------------------------------------
float m_cameraTime;
//--------------------------------------------------------------------------------------------------------------------
/// @brief the elapsed time for the animation of the particle system
//--------------------------------------------------------------------------------------------------------------------
float m_deltaTime;
//--------------------------------------------------------------------------------------------------------------------
/// @brief the negative value of the elapsed time for the animation of the particle system
//--------------------------------------------------------------------------------------------------------------------
float m_slowMotion;
//--------------------------------------------------------------------------------------------------------------------
/// @brief value if the timer is paused or not
//--------------------------------------------------------------------------------------------------------------------
bool m_pause;
};
#endif // TIMER_H