OpenTTD AI API  14.0-beta2
Public Member Functions | Static Public Member Functions
AITimeMode Class Reference

Class to switch the current time. More...

Inheritance diagram for AITimeMode:

Public Member Functions

 AITimeMode (bool calendar)
 Creating an instance of this class switches the time mode used for queries and commands. More...
 

Static Public Member Functions

static bool IsCalendarMode ()
 Check if the script is operating in calendar time mode, or in economy time mode. More...
 

Detailed Description

Class to switch the current time.

If you create an instance of this class, the mode will be switched to either calendar time or economy time mode.

Note
Destroying this object will restore the previous time mode.

Constructor & Destructor Documentation

◆ AITimeMode()

AITimeMode::AITimeMode ( bool  calendar)

Creating an instance of this class switches the time mode used for queries and commands.

Calendar time is used by OpenTTD for technology like vehicle introductions and expiration, and variable snowline. It can be sped up or slowed down by the player. Economy time always runs at the same pace and handles things like cargo production, everything related to money, etc.

Parameters
CalendarShould we use calendar time mode? (Set to false for economy time mode.)

Member Function Documentation

◆ IsCalendarMode()

static bool AITimeMode::IsCalendarMode ( )
static

Check if the script is operating in calendar time mode, or in economy time mode.

See AITimeMode() for more information.

Returns
True if we are in calendar time mode, false if we are in economy time mode.