Bowls
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Pages
Timer Class Reference

creates a timer for use in game More...

#include <Timer.h>

Collaboration diagram for Timer:
Collaboration graph

Static Public Member Functions

static void update (float dt)
 
static bool createTimer (int id, float duration)
 
static float stopTimer (int id)
 
static bool hasTimerFinished (int id)
 

Private Member Functions

 Timer ()
 

Static Private Member Functions

static int searchForIDPos (int id)
 

Static Private Attributes

static const float TIME_INTERVAL
 
static std::vector< TimerStructtimers
 Stores the Timers. More...
 
static int timerCount
 

Detailed Description

creates a timer for use in game

Definition at line 18 of file Timer.h.

Constructor & Destructor Documentation

Timer::Timer ( )
private

Member Function Documentation

static bool Timer::createTimer ( int  id,
float  duration 
)
static

Creates a new timer with a unique id and a duration

Parameters
intthe id
floatthe duration
Returns
bool false is id is not unique
static bool Timer::hasTimerFinished ( int  id)
static

Checks to see if the timer has finished

Parameters
intthe id
Returns
bool if the timer has ended
static int Timer::searchForIDPos ( int  id)
staticprivate
static float Timer::stopTimer ( int  id)
static

Stops the time and returns the time taken

Parameters
intthe id
Returns
float the time taken
static void Timer::update ( float  dt)
static

upadates the time in the timer

Parameters
floatthe deltaTime

Member Data Documentation

const float Timer::TIME_INTERVAL
staticprivate

Definition at line 57 of file Timer.h.

int Timer::timerCount
staticprivate

Definition at line 67 of file Timer.h.

std::vector<TimerStruct> Timer::timers
staticprivate

Stores the Timers.

1- id 2- currentTime 3- duration

Definition at line 66 of file Timer.h.


The documentation for this class was generated from the following file: