69 #define LEAP_YEARS_TILL(year) ((year) == 0 ? 0 : ((year) - 1) / 4 - ((year) - 1) / 100 + ((year) - 1) / 400 + 1) 76 #define DAYS_TILL(year) (DAYS_IN_YEAR * (year) + LEAP_YEARS_TILL(year)) 82 #define DAYS_TILL_ORIGINAL_BASE_YEAR DAYS_TILL(ORIGINAL_BASE_YEAR) 97 #define MAX_DAY (DAYS_TILL(MAX_YEAR + 1) - 1) static const int TOWN_GROWTH_TICKS
cycle duration for towns trying to grow. (this originates from the size of the town array in TTD ...
static const int DAYS_IN_YEAR
days per year
static const int INDUSTRY_CUT_TREE_TICKS
cycle duration for lumber mill's extra action
static const Year ORIGINAL_MAX_YEAR
The maximum year of the original TTD.
static const Ticks INVALID_TICKS
Representation of an invalid number of ticks.
static const Year INVALID_YEAR
Representation of an invalid year.
static const int DAY_TICKS
1 day is 74 ticks; _date_fract used to be uint16 and incremented by 885.
int32 Year
Type for the year, note: 0 based, i.e. starts at the year 0.
static const Year DEF_START_YEAR
The default starting year.
static const Date INVALID_DATE
Representation of an invalid date.
Data structure to convert between Date and triplet (year, month, and day).
static const int CARGO_AGING_TICKS
cycle duration for aging cargo
uint16 DateFract
The fraction of a date we're in, i.e. the number of ticks since the last date changeover.
static const int STATION_RATING_TICKS
cycle duration for updating station rating
uint8 Month
Type for the month, note: 0 based, i.e. 0 = January, 11 = December.
static const Year ORIGINAL_BASE_YEAR
The minimum starting year/base year of the original TTD.
int32 Ticks
The type to store ticks in.
uint8 Day
Type for the day of the month, note: 1 based, first day of a month is 1.
static const int STATION_LINKGRAPH_TICKS
cycle duration for cleaning dead links
static const Year MIN_YEAR
The absolute minimum & maximum years in OTTD.
int32 Date
The type to store our dates in.
static const int INDUSTRY_PRODUCE_TICKS
cycle duration for industry production
static const Year MAX_YEAR
MAX_YEAR, nicely rounded value of the number of years that can be encoded in a single 32 bits date...
static const int STATION_ACCEPTANCE_TICKS
cycle duration for updating station acceptance
static const int DAYS_IN_LEAP_YEAR
sometimes, you need one day more...
static const Year ORIGINAL_END_YEAR
The original ending year.