13 #include "../stdafx.h"
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);
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.
The TimerManager manages a single Timer-type.
static bool Elapsed(TElapsed value)
Called when time for this timer elapsed.
PauseMode _pause_mode
The current pause mode.
@ PM_COMMAND_DURING_PAUSE
A game paused, and a command executed during the pause; resets on autosave.
@ PM_UNPAUSED
A normal unpaused game.
Definition of Interval and OneShot timers.
Definition of the real time game-timer.