OpenTTD Source
20240919-master-gdf0233f4c2
|
Go to the documentation of this file.
13 #include "../stdafx.h"
17 #include "../safeguards.h"
22 if (this->
period == std::chrono::milliseconds::zero())
return;
27 while (this->
storage.elapsed >= this->period) {
33 this->callback(count);
40 if (this->
fired)
return;
41 if (this->
period == std::chrono::milliseconds::zero())
return;
45 if (this->
storage.elapsed >= this->period) {
57 for (
auto timer : timers) {
58 timer->Elapsed(delta);
static std::set< BaseTimer< TTimerType > *, base_timer_sorter > & GetTimers()
Singleton list, to store all the active timers.
TPeriod period
The period of the timer.
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.
bool fired
Whether the timeout has occurred.
The TimerManager manages a single Timer-type.
static bool Elapsed(TElapsed value)
Called when time for this timer elapsed.
TStorage storage
The storage of the timer.