Aurore
A Switch-like interface for your app, on every screen
Loading...
Searching...
No Matches
aurore::Timer Class Reference

#include <aurore/core/timer.hpp>

Inheritance diagram for aurore::Timer:
aurore::FiniteTicking aurore::Ticking

Public Member Functions

void start (Time duration)
 
void start ()
 
void setDuration (Time duration)
 
void onStart () override
 
bool onUpdate (Time delta) override
 
void onReset () override
 
void onRewind () override
 
- Public Member Functions inherited from aurore::FiniteTicking
void rewind ()
 
void reset ()
 
- Public Member Functions inherited from aurore::Ticking
virtual ~Ticking ()
 
void start ()
 
void stop ()
 
void setEndCallback (TickingEndCallback endCallback)
 
void setTickCallback (TickingTickCallback tickCallback)
 
bool isRunning ()
 

Protected Attributes

Time duration = 0
 
Time progress = 0
 

Additional Inherited Members

- Static Public Member Functions inherited from aurore::Ticking
static void updateTickings ()
 
- Static Public Attributes inherited from aurore::Ticking
static std::vector< Ticking * > runningTickings
 
- Protected Member Functions inherited from aurore::Ticking
virtual void onStop ()
 

Member Function Documentation

◆ onReset()

void aurore::Timer::onReset ( )
overridevirtual

Called when the ticking gets reset.

Reimplemented from aurore::FiniteTicking.

◆ onRewind()

void aurore::Timer::onRewind ( )
overridevirtual

Called when the ticking gets rewound.

Reimplemented from aurore::FiniteTicking.

◆ onStart()

void aurore::Timer::onStart ( )
overridevirtual

Called when the ticking becomes active.

Reimplemented from aurore::Ticking.

◆ onUpdate()

bool aurore::Timer::onUpdate ( Time  delta)
overridevirtual

Executed every frame while the ticking lives. Delta is the time difference in ms between the last frame and the current one. Must return false if the ticking is finished and should be removed from the list of active tickings. The end callback will automatically be called then.

Implements aurore::Ticking.

◆ setDuration()

void aurore::Timer::setDuration ( Time  duration)

Sets the duration of the timer, in ms. Does not stop or reset it.

◆ start() [1/2]

void aurore::Timer::start ( )

Starts the timer with the already set duration.

◆ start() [2/2]

void aurore::Timer::start ( Time  duration)

Starts the timer directly with a given duration, in ms.

Member Data Documentation

◆ duration

Time aurore::Timer::duration = 0
protected

◆ progress

Time aurore::Timer::progress = 0
protected

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