Vigilante Game Framework  1.0.0.8
A 2D/3D C++ Game Framework using SFML.
Public Types | Public Member Functions | List of all members
VTimerEvent Class Reference

Special VTimer that can perform an event at a set interval. Like VTimer, it can be paused or restarted at any point. It can also be looped. More...

#include <VTimer.h>

Inheritance diagram for VTimerEvent:
VTimer

Public Types

typedef VTimer VSUPERCLASS
 Used to call parent class functions when they are overrided in class.
 

Public Member Functions

 VTimerEvent (unsigned int time, std::function< void()> eventFunction, bool looping=false)
 
void Stop ()
 Stops the timer and removes its event function.
 
void SetLooping (bool value)
 
bool GetLooping ()
 
virtual float Update (float dt)
 
- Public Member Functions inherited from VTimer
bool IsPaused ()
 
float Restart ()
 
void Pause ()
 Pauses the timer.
 
void Resume ()
 Resumes timer at current point.
 
float Seconds ()
 
unsigned int Milliseconds ()
 
uint64_t Microseconds ()
 

Detailed Description

Special VTimer that can perform an event at a set interval. Like VTimer, it can be paused or restarted at any point. It can also be looped.

Constructor & Destructor Documentation

◆ VTimerEvent()

VTimerEvent::VTimerEvent ( unsigned int  time,
std::function< void()>  eventFunction,
bool  looping = false 
)
Parameters
timeTime in milliseconds for the event to occur.
eventFunctionThe event to call.
loopingIf true, the timeline will start at the beginning once finished, otherwise it will destroy itself.

Member Function Documentation

◆ GetLooping()

bool VTimerEvent::GetLooping ( )
Returns
If the timeline is looping or not.

◆ SetLooping()

void VTimerEvent::SetLooping ( bool  value)
Parameters
valueIf true, the timeline will start from the beginning instead of being destroyed.

◆ Update()

virtual float VTimerEvent::Update ( float  dt)
virtual

Updates the time.

Parameters
dtDelta Time to increment the time by.
Returns
The resulting time once updated.

Reimplemented from VTimer.


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