OpenTTD Source 20250312-master-gcdcc6b491d
EngineInfo Struct Reference

Information about a vehicle. More...

#include <engine_type.h>

Data Fields

TimerGameCalendar::Date base_intro {}
 Basic date of engine introduction (without random parts).
 
TimerGameCalendar::Year lifelength {}
 Lifetime of a single vehicle.
 
TimerGameCalendar::Year base_life {}
 Basic duration of engine availability (without random parts). 0xFF means infinite life.
 
uint8_t decay_speed = 0
 
uint8_t load_amount = 0
 
LandscapeTypes climates {}
 Climates supported by the engine.
 
CargoType cargo_type {}
 
std::variant< CargoLabel, MixedCargoTypecargo_label {}
 
CargoTypes refit_mask {}
 
uint8_t refit_cost = 0
 
EngineMiscFlags misc_flags {}
 Miscellaneous flags.
 
VehicleCallbackMasks callback_mask {}
 Bitmask of vehicle callbacks that have to be called.
 
int8_t retire_early = 0
 Number of years early to retire vehicle.
 
ExtraEngineFlags extra_flags {}
 
StringID string_id = INVALID_STRING_ID
 Default name of engine.
 
uint16_t cargo_age_period = 0
 Number of ticks before carried cargo is aged.
 
EngineID variant_id {}
 Engine variant ID. If set, will be treated specially in purchase lists.
 

Detailed Description

Information about a vehicle.

See also
table/engines.h

Definition at line 170 of file engine_type.h.

Field Documentation

◆ base_intro

TimerGameCalendar::Date EngineInfo::base_intro {}

Basic date of engine introduction (without random parts).

Definition at line 171 of file engine_type.h.

Referenced by AircraftVehicleChangeInfo(), CommonVehicleChangeInfo(), RailVehicleChangeInfo(), RoadVehicleChangeInfo(), SetYearEngineAgingStops(), ShipVehicleChangeInfo(), and StartupOneEngine().

◆ base_life

TimerGameCalendar::Year EngineInfo::base_life {}

Basic duration of engine availability (without random parts). 0xFF means infinite life.

Definition at line 173 of file engine_type.h.

Referenced by CalcEngineReliability(), CommonVehicleChangeInfo(), and StartupOneEngine().

◆ callback_mask

◆ cargo_age_period

uint16_t EngineInfo::cargo_age_period = 0

◆ cargo_label

std::variant<CargoLabel, MixedCargoType> EngineInfo::cargo_label {}

Definition at line 178 of file engine_type.h.

◆ cargo_type

CargoType EngineInfo::cargo_type {}

Definition at line 177 of file engine_type.h.

◆ climates

◆ decay_speed

uint8_t EngineInfo::decay_speed = 0

Definition at line 174 of file engine_type.h.

◆ extra_flags

ExtraEngineFlags EngineInfo::extra_flags {}

Definition at line 184 of file engine_type.h.

◆ lifelength

TimerGameCalendar::Year EngineInfo::lifelength {}

Lifetime of a single vehicle.

Definition at line 172 of file engine_type.h.

Referenced by CommonVehicleChangeInfo(), Engine::GetLifeLengthInDays(), SetYearEngineAgingStops(), and StartupOneEngine().

◆ load_amount

uint8_t EngineInfo::load_amount = 0

Definition at line 175 of file engine_type.h.

◆ misc_flags

◆ refit_cost

uint8_t EngineInfo::refit_cost = 0

Definition at line 180 of file engine_type.h.

◆ refit_mask

CargoTypes EngineInfo::refit_mask {}

Definition at line 179 of file engine_type.h.

◆ retire_early

int8_t EngineInfo::retire_early = 0

Number of years early to retire vehicle.

Definition at line 183 of file engine_type.h.

Referenced by AircraftVehicleChangeInfo(), CalcEngineReliability(), RailVehicleChangeInfo(), RoadVehicleChangeInfo(), ShipVehicleChangeInfo(), and StartupOneEngine().

◆ string_id

StringID EngineInfo::string_id = INVALID_STRING_ID

Default name of engine.

Definition at line 185 of file engine_type.h.

Referenced by FinaliseEngineArray(), and Engine::IsEnabled().

◆ variant_id

EngineID EngineInfo::variant_id {}

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