OpenTTD Source
20240915-master-g3784a3d3d6
|
Go to the documentation of this file.
10 #ifndef TIMER_GAME_CALENDAR_H
11 #define TIMER_GAME_CALENDAR_H
13 #include "../stdafx.h"
14 #include "../core/strong_typedef_type.hpp"
48 static constexpr
int DEF_MINUTES_PER_YEAR = 12;
49 static constexpr
int FROZEN_MINUTES_PER_YEAR = 0;
50 static constexpr
int MAX_MINUTES_PER_YEAR = 10080;
static DateFract date_fract
Fractional part of the day.
Template class for all TimerGame based timers.
static uint16_t sub_date_fract
Subpart of date_fract that we use when calendar days are slower than economy days.
Template class for time constants shared by both Calendar and Economy time.
Timer that is increased every 27ms, and counts towards ticks / days / months / years.
static Date ConvertYMDToDate(Year year, Month month, Day day)
Converts a tuple of Year, Month and Day to a Date.
static YearMonthDay ConvertDateToYMD(Date date)
Converts a Date to a Year, Month & Day.
static Month month
Current month (0..11).
static void SetDate(Date date, DateFract fract)
Set the date.
uint16_t DateFract
The fraction of a date we're in, i.e.
uint8_t Day
Type for the day of the month, note: 1 based, first day of a month is 1.
Storage class for Calendar time constants.
static Date date
Current date in days (day counter).
uint8_t Month
Type for the month, note: 0 based, i.e.
static Year year
Current year, starting at 0.