OpenTTD Source: EngineInfo Struct Reference

OpenTTD Source 15.0-RC2

Data Fields
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, MixedCargoType > | cargo_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 198 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 199 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 201 of file engine_type.h.

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

## ◆ callback_mask

VehicleCallbackMasks EngineInfo::callback_mask {}

Bitmask of vehicle callbacks that have to be called.

Definition at line 210 of file engine_type.h.

Referenced by AddArticulatedParts(), AircraftVehicleChangeInfo(), RefitWindow::BuildRefitList(), CmdReverseTrainDirection(), Train::ConsistChanged(), Engine::DetermineCapacity(), GetArticulatedRefitMasks(), GetBestFittingSubType(), GetCapacityOfArticulatedParts(), GetCargoSubtypeText(), GetCargoTypesOfArticulatedParts(), GetLoadAmount(), IsArticulatedEngine(), IsArticulatedVehicleRefittable(), IsEngineRefittable(), PlayVehicleSound(), RailVehicleChangeInfo(), RoadVehicleChangeInfo(), ShipVehicleChangeInfo(), and Vehicle::UpdateVisualEffect().

## ◆ cargo_age_period

uint16_t EngineInfo::cargo_age_period = 0

Number of ticks before carried cargo is aged.

Definition at line 214 of file engine_type.h.

Referenced by AircraftVehicleChangeInfo(), Train::ConsistChanged(), RailVehicleChangeInfo(), RoadVehicleChangeInfo(), RoadVehUpdateCache(), ShipVehicleChangeInfo(), and UpdateAircraftCache().

## ◆ cargo_label

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

Definition at line 206 of file engine_type.h.

## ◆ cargo_type

CargoType EngineInfo::cargo_type {}

Definition at line 205 of file engine_type.h.

## ◆ climates

LandscapeTypes EngineInfo::climates {}

Climates supported by the engine.

Definition at line 204 of file engine_type.h.

Referenced by CalculateRefitMasks(), CommonVehicleChangeInfo(), FixTTOEngines(), GetCompanyRailTypes(), GetCompanyRoadTypes(), GetRailTypes(), GetRoadTypes(), Engine::IsEnabled(), SetYearEngineAgingStops(), and StartupOneEngine().

## ◆ decay_speed

uint8_t EngineInfo::decay_speed = 0

Definition at line 202 of file engine_type.h.

## ◆ extra_flags

ExtraEngineFlags EngineInfo::extra_flags {}

Definition at line 212 of file engine_type.h.

## ◆ lifelength

TimerGameCalendar::Year EngineInfo::lifelength {}

Lifetime of a single vehicle.

Definition at line 200 of file engine_type.h.

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

## ◆ load_amount

uint8_t EngineInfo::load_amount = 0

Definition at line 203 of file engine_type.h.

## ◆ misc_flags

EngineMiscFlags EngineInfo::misc_flags {}

Miscellaneous flags.

See also
  EngineMiscFlags

Definition at line 209 of file engine_type.h.

Referenced by AfterLoadGame(), AircraftVehicleChangeInfo(), RefitWindow::BuildRefitList(), CheckAutoreplaceValidity(), Train::ConsistChanged(), Engine::DetermineCapacity(), GetEngineLiveryScheme(), GetLoadAmount(), RailVehicleChangeInfo(), RefitVehicle(), RoadVehicleChangeInfo(), ShipVehicleChangeInfo(), and Train::UpdateDeltaXY().

## ◆ refit_cost

uint8_t EngineInfo::refit_cost = 0

Definition at line 208 of file engine_type.h.

## ◆ refit_mask

CargoTypes EngineInfo::refit_mask {}

Definition at line 207 of file engine_type.h.

## ◆ retire_early

int8_t EngineInfo::retire_early = 0

Number of years early to retire vehicle.

Definition at line 211 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 213 of file engine_type.h.

Referenced by Engine::IsEnabled().

## ◆ variant_id

EngineID EngineInfo::variant_id {}

Engine variant ID. If set, will be treated specially in purchase lists.

Definition at line 215 of file engine_type.h.

Referenced by AircraftVehicleChangeInfo(), CalcEngineReliability(), ReplaceVehicleWindow::GenerateReplaceVehList(), Engine::IsVariantHidden(), RailVehicleChangeInfo(), RoadVehicleChangeInfo(), ShipVehicleChangeInfo(), and StartupOneEngine().

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

- src/engine_type.h