OpenTTD Source  20241108-master-g80f628063a
TimerGameConst< T > Class Template Reference

Template class for time constants shared by both Calendar and Economy time. More...

#include <timer_game_common.h>

Static Public Attributes

static constexpr int DAYS_IN_YEAR = 365
 days per year
 
static constexpr int DAYS_IN_LEAP_YEAR = 366
 sometimes, you need one day more...
 
static constexpr int MONTHS_IN_YEAR = 12
 months per year
 
static constexpr int SECONDS_PER_DAY = 2
 approximate seconds per day, not for precise calculations
 
static constexpr TimerGame< T >::Year ORIGINAL_BASE_YEAR = 1920
 The minimum starting year/base year of the original TTD.
 
static constexpr TimerGame< T >::Year ORIGINAL_END_YEAR = 2051
 The original ending year.
 
static constexpr TimerGame< T >::Year ORIGINAL_MAX_YEAR = 2090
 The maximum year of the original TTD.
 
static constexpr TimerGame< T >::Year MAX_YEAR = 5000000
 MAX_YEAR, nicely rounded value of the number of years that can be encoded in a single 32 bits date, about 2^31 / 366 years.
 
static constexpr TimerGame< T >::Year MIN_YEAR = 0
 The absolute minimum year in OTTD.
 
static constexpr TimerGame< T >::Year DEF_START_YEAR = 1950
 The default starting year.
 
static constexpr TimerGame< T >::Year DEF_END_YEAR = ORIGINAL_END_YEAR - 1
 The default scoring end year.
 
static constexpr TimerGame< T >::Date DAYS_TILL_ORIGINAL_BASE_YEAR = TimerGame<T>::DateAtStartOfYear(ORIGINAL_BASE_YEAR)
 The date of the first day of the original base year.
 
static constexpr TimerGame< T >::Date MAX_DATE = TimerGame<T>::DateAtStartOfYear(MAX_YEAR + 1) - 1
 The date of the last day of the max year.
 
static constexpr TimerGame< T >::Date MIN_DATE = 0
 The date on January 1, year 0.
 
static constexpr TimerGame< T >::Year INVALID_YEAR = -1
 Representation of an invalid year.
 
static constexpr TimerGame< T >::Date INVALID_DATE = -1
 Representation of an invalid date.
 

Detailed Description

template<class T>
class TimerGameConst< T >

Template class for time constants shared by both Calendar and Economy time.

Definition at line 147 of file timer_game_common.h.


The documentation for this class was generated from the following file: