|
Vigilante Game Framework
1.0.0.8
A 2D/3D C++ Game Framework using SFML.
|
#include <VTimer.h>
Public Member Functions | |
| VTimeManager () | |
| Constructor. | |
| ~VTimeManager () | |
| Destructor. | |
| VTimer * | AddTimer () |
| VTimerEvent * | AddTimerEvent (unsigned int time, std::function< void()> eventFunction, bool looping=false) |
| void | AddTimer (VTimer *timer) |
| void | RemoveTimer (VTimer *timer) |
| void | Update (float dt) |
| void | Reserve (size_t size) |
| void | Clear (bool destroy=true) |
| int | Count () |
Manages multiple timers at once in a singleton data structure. An independent VTimeManager can also be created, however any VTimer or VTimeEvent objects must be constructed with the AddToManager parameter set to false.
| VTimer* VTimeManager::AddTimer | ( | ) |
| void VTimeManager::AddTimer | ( | VTimer * | timer | ) |
Adds a timer from the list.
| timer | The VTimer object to add to the list. |
| VTimerEvent* VTimeManager::AddTimerEvent | ( | unsigned int | time, |
| std::function< void()> | eventFunction, | ||
| bool | looping = false |
||
| ) |
| time | Time in milliseconds for the event to occur. |
| eventFunction | The event to call. |
| looping | If true, the timeline will start at the beginning once finished, otherwise it will destroy itself. |
| void VTimeManager::Clear | ( | bool | destroy = true | ) |
Clears timer list.
| destroy | Destroys all timers in the list if true, else it'd need to be done manually. |
| int VTimeManager::Count | ( | ) |
| void VTimeManager::RemoveTimer | ( | VTimer * | timer | ) |
Removes a timer from the list.
| timer | The VTimer object to remove from the list. |
| void VTimeManager::Reserve | ( | size_t | size | ) |
Reserves a set amount of timers in the list, good for optimization purposes.
| size | The amount of timers to reserve in the list. |
| void VTimeManager::Update | ( | float | dt | ) |
Updates all timers.
| dt | Delta Time to increment the time by. |
1.8.14