17#include "../safeguards.h"
24 if (this->period.value == 0)
return;
26 this->storage.elapsed += delta;
29 while (this->storage.elapsed >= this->period.value) {
30 this->storage.elapsed -= this->period.value;
35 this->callback(count);
42 if (this->fired)
return;
43 if (this->period.value == 0)
return;
45 this->storage.elapsed += delta;
47 if (this->storage.elapsed >= this->period.value) {
59 timer->Elapsed(delta);
76 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.
Timer that represents the game-ticks.
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 bool Elapsed(TElapsed value)
Called when time for this timer elapsed.
Definition of Interval and OneShot timers.
Definition of the tick-based game-timer.