50 TimerGameEconomy::YearMonthDay ymd;
97 if (newgame)
return (
_settings_newgame.economy.timekeeping_units == TimekeepingUnits::Wallclock);
99 return (
_settings_game.economy.timekeeping_units == TimekeepingUnits::Wallclock);
105 if (trigger == this->period.trigger) {
113 if (this->fired)
return;
115 if (trigger == this->period.trigger) {
124 if (_game_mode == GM_MENU)
return false;
149 for (
auto timer : timers) {
150 timer->Elapsed(TimerGameEconomy::Trigger::Day);
154 for (
auto timer : timers) {
155 timer->Elapsed(TimerGameEconomy::Trigger::Week);
160 for (
auto timer : timers) {
161 timer->Elapsed(TimerGameEconomy::Trigger::Month);
165 for (
auto timer : timers) {
166 timer->Elapsed(TimerGameEconomy::Trigger::Quarter);
172 for (
auto timer : timers) {
173 timer->Elapsed(TimerGameEconomy::Trigger::Year);
195 if (period.priority == TimerGameEconomy::Priority::None)
return;
201 if (timer->period.trigger != period.trigger)
continue;
203 assert(timer->period.priority != period.priority);
static constexpr int DAYS_IN_ECONOMY_MONTH
Days in an economy month, when in wallclock timekeeping mode.
static constexpr int DAYS_IN_ECONOMY_YEAR
Days in an economy year, when in wallclock timekeeping mode.
void Elapsed(TElapsed count) override
Called by the timer manager to notify the timer that the given amount of time has elapsed.
A connected component of a link graph.
static constexpr TimerGameTick::Ticks DAY_TICKS
1 day is 74 ticks; TimerGameCalendar::date_fract used to be uint16_t and incremented by 885.
void Elapsed(TElapsed count) override
Called by the timer manager to notify the timer that the given amount of time has elapsed.
static constexpr int MONTHS_IN_YEAR
static constexpr int DAYS_IN_YEAR
static constexpr TimerGame< struct Economy >::Year MAX_YEAR
static constexpr int DAYS_IN_LEAP_YEAR
static Date date
Current date in days (day counter).
static Year year
Current year, starting at 0.
static Month month
Current month (0..11).
static bool UsingWallclockUnits(bool newgame=false)
Check if we are using wallclock units.
static DateFract date_fract
Fractional part of the day.
static YearMonthDay ConvertDateToYMD(Date date)
Converts a Date to a Year, Month & Day.
static void SetDate(Date date, DateFract fract)
Set the date.
static uint days_since_last_month
Number of days that have elapsed since the last month.
static Date ConvertYMDToDate(Year year, Month month, Day day)
Converts a tuple of Year, Month and Day to a Date.
static YearMonthDay CalendarConvertDateToYMD(Date date)
static Date CalendarConvertYMDToDate(Year year, Month month, Day day)
static constexpr bool IsLeapYear(Year year)
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.
Declaration of link graph classes used for cargo distribution.
A number of safeguards to prevent using unsafe methods.
GameSettings _settings_game
Game settings of a running game or the scenario editor.
GameSettings _settings_newgame
Game settings for new games (updated from the intro screen).
Definition of base types and functions in a cross-platform compatible way.
static Pool::IterateWrapper< Vehicle > Iterate(size_t from=0)
Definition of Interval and OneShot timers.
Definition of the game-economy-timer.
Definition of the tick-based game-timer.
Base class for all vehicles.