21 if (this->period.value == 0)
return;
23 this->storage.elapsed += delta;
26 while (this->storage.elapsed >= this->period.value) {
27 this->storage.elapsed -= this->period.value;
32 this->callback(count);
39 if (this->fired)
return;
40 if (this->period.value == 0)
return;
42 this->storage.elapsed += delta;
44 if (this->storage.elapsed >= this->period.value) {
56 timer->Elapsed(delta);
73 assert(timer->period.priority != period.priority);
void Elapsed(TElapsed count) override
Called by the timer manager to notify the timer that the given amount of time has elapsed.
void Elapsed(TElapsed count) override
Called by the timer manager to notify the timer that the given amount of time has elapsed.
uint64_t TickCounter
The type that the tick counter is stored in.
static TickCounter counter
Monotonic counter, in ticks, since start of game.
@ None
These timers can be executed in any order; the order is not relevant.
The TimerManager manages a single Timer-type.
static std::set< BaseTimer< TTimerType > *, base_timer_sorter > & GetTimers()
Singleton list, to store all the active timers.
static bool Elapsed(TElapsed value)
Called when time for this timer elapsed.
A number of safeguards to prevent using unsafe methods.
Definition of base types and functions in a cross-platform compatible way.
Definition of Interval and OneShot timers.
Definition of the tick-based game-timer.