Bowls
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Pages
Timer.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <vector>
4 
5 #include "cgg/cgg.h"
6 
8 struct TimerStruct
9 {
10  int id;
11  float currentTime;
12  float duration;
13 };
14 
18 class Timer
19 {
20 public:
26  static void update(float dt);
27 
35  static bool createTimer(int id, float duration);
36 
43  static float stopTimer(int id);
44 
51  static bool hasTimerFinished(int id);
52 
53 private:
54  //No one should call this so it is private
55  Timer();
56 
57  static const float TIME_INTERVAL;
58 
66  static std::vector<TimerStruct> timers;
67  static int timerCount;
68  static int searchForIDPos(int id);
69 };
a structure for the timer
Definition: Timer.h:8
static void update(float dt)
static bool createTimer(int id, float duration)
creates a timer for use in game
Definition: Timer.h:18
static int timerCount
Definition: Timer.h:67
static float stopTimer(int id)
static const float TIME_INTERVAL
Definition: Timer.h:57
static bool hasTimerFinished(int id)
static int searchForIDPos(int id)
float duration
Definition: Timer.h:12
float currentTime
Definition: Timer.h:11
static std::vector< TimerStruct > timers
Stores the Timers.
Definition: Timer.h:66
int id
Definition: Timer.h:10