OpenTTD Source 20250312-master-gcdcc6b491d
RailVehicleInfo Struct Reference

Information about a rail vehicle. More...

#include <engine_type.h>

Data Fields

uint8_t image_index = 0
 
RailVehicleTypes railveh_type {}
 
uint8_t cost_factor = 0
 Purchase cost factor; For multiheaded engines the sum of both engine prices.
 
RailType railtype {}
 Railtype, mangled if elrail is disabled.
 
RailType intended_railtype {}
 Intended railtype, regardless of elrail being enabled or disabled.
 
uint8_t ai_passenger_only = 0
 Bit value to tell AI that this engine is for passenger use only.
 
uint16_t max_speed = 0
 Maximum speed (1 unit = 1/1.6 mph = 1 km-ish/h)
 
uint16_t power = 0
 Power of engine (hp); For multiheaded engines the sum of both engine powers.
 
uint16_t weight = 0
 Weight of vehicle (tons); For multiheaded engines the weight of each single engine.
 
uint8_t running_cost = 0
 Running cost of engine; For multiheaded engines the sum of both running costs.
 
Price running_cost_class {}
 
EngineClass engclass {}
 Class of engine for this vehicle.
 
uint8_t capacity = 0
 Cargo capacity of vehicle; For multiheaded engines the capacity of each single engine.
 
uint16_t pow_wag_power = 0
 Extra power applied to consist if wagon should be powered.
 
uint8_t pow_wag_weight = 0
 Extra weight applied to consist if wagon should be powered.
 
uint8_t visual_effect = 0
 Bitstuffed NewGRF visual effect data.
 
uint8_t shorten_factor = 0
 length on main map for this type is 8 - shorten_factor
 
uint8_t tractive_effort = 0
 Tractive effort coefficient.
 
uint8_t air_drag = 0
 Coefficient of air drag.
 
uint8_t user_def_data = 0
 Property 0x25: "User-defined bit mask" Used only for (very few) NewGRF vehicles.
 
int16_t curve_speed_mod = 0
 Modifier to maximum speed in curves (fixed-point binary with 8 fractional bits)
 

Detailed Description

Information about a rail vehicle.

Definition at line 46 of file engine_type.h.

Field Documentation

◆ ai_passenger_only

uint8_t RailVehicleInfo::ai_passenger_only = 0

Bit value to tell AI that this engine is for passenger use only.

Definition at line 52 of file engine_type.h.

Referenced by RailVehicleChangeInfo().

◆ air_drag

uint8_t RailVehicleInfo::air_drag = 0

Coefficient of air drag.

Definition at line 65 of file engine_type.h.

Referenced by Train::GetAirDrag(), and RailVehicleChangeInfo().

◆ capacity

uint8_t RailVehicleInfo::capacity = 0

Cargo capacity of vehicle; For multiheaded engines the capacity of each single engine.

Definition at line 59 of file engine_type.h.

Referenced by AddArticulatedParts(), CalculateRefitMasks(), CmdBuildRailVehicle(), CmdBuildRailWagon(), and RailVehicleChangeInfo().

◆ cost_factor

uint8_t RailVehicleInfo::cost_factor = 0

Purchase cost factor; For multiheaded engines the sum of both engine prices.

Definition at line 49 of file engine_type.h.

Referenced by RailVehicleChangeInfo().

◆ curve_speed_mod

int16_t RailVehicleInfo::curve_speed_mod = 0

Modifier to maximum speed in curves (fixed-point binary with 8 fractional bits)

Definition at line 67 of file engine_type.h.

Referenced by RailVehicleChangeInfo().

◆ engclass

EngineClass RailVehicleInfo::engclass {}

Class of engine for this vehicle.

Definition at line 58 of file engine_type.h.

Referenced by GetEngineLiveryScheme(), RailVehicleChangeInfo(), and Vehicle::UpdateVisualEffect().

◆ image_index

uint8_t RailVehicleInfo::image_index = 0

Definition at line 47 of file engine_type.h.

◆ intended_railtype

RailType RailVehicleInfo::intended_railtype {}

Intended railtype, regardless of elrail being enabled or disabled.

Definition at line 51 of file engine_type.h.

Referenced by AfterLoadGRFs().

◆ max_speed

uint16_t RailVehicleInfo::max_speed = 0

Maximum speed (1 unit = 1/1.6 mph = 1 km-ish/h)

Definition at line 53 of file engine_type.h.

Referenced by Train::ConsistChanged(), and RailVehicleChangeInfo().

◆ pow_wag_power

uint16_t RailVehicleInfo::pow_wag_power = 0

Extra power applied to consist if wagon should be powered.

Definition at line 60 of file engine_type.h.

Referenced by Train::ConsistChanged(), Train::GetPoweredPartPower(), and RailVehicleChangeInfo().

◆ pow_wag_weight

uint8_t RailVehicleInfo::pow_wag_weight = 0

Extra weight applied to consist if wagon should be powered.

Definition at line 61 of file engine_type.h.

Referenced by Train::GetMaxWeight(), Train::GetWeight(), and RailVehicleChangeInfo().

◆ power

uint16_t RailVehicleInfo::power = 0

Power of engine (hp); For multiheaded engines the sum of both engine powers.

Definition at line 54 of file engine_type.h.

Referenced by Train::ConsistChanged(), and RailVehicleChangeInfo().

◆ railtype

◆ railveh_type

RailVehicleTypes RailVehicleInfo::railveh_type {}

Definition at line 48 of file engine_type.h.

◆ running_cost

uint8_t RailVehicleInfo::running_cost = 0

Running cost of engine; For multiheaded engines the sum of both running costs.

Definition at line 56 of file engine_type.h.

Referenced by Train::GetRunningCost(), and RailVehicleChangeInfo().

◆ running_cost_class

Price RailVehicleInfo::running_cost_class {}

Definition at line 57 of file engine_type.h.

◆ shorten_factor

uint8_t RailVehicleInfo::shorten_factor = 0

length on main map for this type is 8 - shorten_factor

Definition at line 63 of file engine_type.h.

Referenced by Train::ConsistChanged(), and RailVehicleChangeInfo().

◆ tractive_effort

uint8_t RailVehicleInfo::tractive_effort = 0

Tractive effort coefficient.

Definition at line 64 of file engine_type.h.

Referenced by RailVehicleChangeInfo().

◆ user_def_data

uint8_t RailVehicleInfo::user_def_data = 0

Property 0x25: "User-defined bit mask" Used only for (very few) NewGRF vehicles.

Definition at line 66 of file engine_type.h.

Referenced by Train::ConsistChanged(), and RailVehicleChangeInfo().

◆ visual_effect

uint8_t RailVehicleInfo::visual_effect = 0

Bitstuffed NewGRF visual effect data.

Definition at line 62 of file engine_type.h.

Referenced by RailVehicleChangeInfo(), and Vehicle::UpdateVisualEffect().

◆ weight

uint16_t RailVehicleInfo::weight = 0

Weight of vehicle (tons); For multiheaded engines the weight of each single engine.

Definition at line 55 of file engine_type.h.

Referenced by RailVehicleChangeInfo().


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