14#include "../openttd.h"
18#include "../safeguards.h"
23 if (this->period.period == std::chrono::milliseconds::zero())
return;
27 this->storage.elapsed += delta;
30 while (this->storage.elapsed >= this->period.period) {
31 this->storage.elapsed -= this->period.period;
36 this->callback(count);
43 if (this->fired)
return;
44 if (this->period.period == std::chrono::milliseconds::zero())
return;
48 this->storage.elapsed += delta;
50 if (this->storage.elapsed >= this->period.period) {
60 timer->Elapsed(delta);
constexpr bool Test(Tvalue_type value) const
Test if the value-th bit is set.
constexpr bool Any(const Timpl &other) const
Test if any of the given values are set.
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 real time for game-related purposes.
@ UNPAUSED
Only run when not paused.
@ AUTOSAVE
Only run when not paused or there was a Command executed recently.
The TimerManager manages a single Timer-type.
static bool Elapsed(TElapsed value)
Called when time for this timer elapsed.
PauseModes _pause_mode
The current pause mode.
@ CommandDuringPause
A game paused, and a command executed during the pause; resets on autosave.
Definition of Interval and OneShot timers.
Definition of the real time game-timer.