OpenTTD Source: EngineInfo Struct Reference

OpenTTD Source 15.0-beta1

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
uint8_t | load_amount
uint8_t | climates
| Climates supported by the engine.
CargoID | cargo_type
std::variant< CargoLabel, MixedCargoType > | cargo_label
CargoTypes | refit_mask
uint8_t | refit_cost
uint8_t | misc_flags
| Miscellaneous flags.
uint16_t | callback_mask
| Bitmask of vehicle callbacks that have to be called.
int8_t | retire_early
| Number of years early to retire vehicle.
ExtraEngineFlags | extra_flags
StringID | string_id
| Default name of engine.
uint16_t | cargo_age_period
| 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 148 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 149 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 151 of file engine_type.h.

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

## ◆ callback_mask

uint16_t EngineInfo::callback_mask

Bitmask of vehicle callbacks that have to be called.

Definition at line 160 of file engine_type.h.

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

## ◆ cargo_age_period

uint16_t EngineInfo::cargo_age_period

Number of ticks before carried cargo is aged.

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

## ◆ cargo_type

CargoID EngineInfo::cargo_type

Definition at line 155 of file engine_type.h.

## ◆ climates

uint8_t EngineInfo::climates

Climates supported by the engine.

Definition at line 154 of file engine_type.h.

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

## ◆ decay_speed

uint8_t EngineInfo::decay_speed

Definition at line 152 of file engine_type.h.

## ◆ extra_flags

ExtraEngineFlags EngineInfo::extra_flags

Definition at line 162 of file engine_type.h.

## ◆ lifelength

TimerGameCalendar::Year EngineInfo::lifelength

Lifetime of a single vehicle.

Definition at line 150 of file engine_type.h.

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

## ◆ load_amount

uint8_t EngineInfo::load_amount

Definition at line 153 of file engine_type.h.

## ◆ misc_flags

uint8_t EngineInfo::misc_flags

Miscellaneous flags.

See also
  EngineMiscFlags

Definition at line 159 of file engine_type.h.

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

## ◆ refit_cost

uint8_t EngineInfo::refit_cost

Definition at line 158 of file engine_type.h.

## ◆ refit_mask

CargoTypes EngineInfo::refit_mask

Definition at line 157 of file engine_type.h.

## ◆ retire_early

int8_t EngineInfo::retire_early

Number of years early to retire vehicle.

Definition at line 161 of file engine_type.h.

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

## ◆ string_id

StringID EngineInfo::string_id

Default name of engine.

Definition at line 163 of file engine_type.h.

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

## ◆ variant_id

EngineID EngineInfo::variant_id

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

Definition at line 165 of file engine_type.h.

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

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

- src/engine_type.h