OpenTTD Source: RailVehicleInfo Struct Reference

OpenTTD Source 15.3

Data Fields
RailVehicleInfo Struct Reference

Information about a rail vehicle. More...

`#include <engine_type.h>`

## Data Fields
uint8_t | image_index = 0
RailVehicleTypes | railveh_type = RAILVEH_WAGON
uint8_t | cost_factor = 0
| Purchase cost factor; For multiheaded engines the sum of both engine prices.
RailTypes | railtypes {RAILTYPE_RAIL}
| Railtypes, mangled if elrail is disabled.
RailTypes | intended_railtypes {RAILTYPE_RAIL}
| Intended railtypes, 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 = VE_DEFAULT
| 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 74 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 80 of file engine_type.h.

Referenced by RailVehicleChangeInfo().

## ◆ air_drag

uint8_t RailVehicleInfo::air_drag = 0

Coefficient of air drag.

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

Referenced by 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 77 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 95 of file engine_type.h.

Referenced by RailVehicleChangeInfo().

## ◆ engclass

EngineClass RailVehicleInfo::engclass {}

Class of engine for this vehicle.

Definition at line 86 of file engine_type.h.

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

## ◆ image_index

uint8_t RailVehicleInfo::image_index = 0

Definition at line 75 of file engine_type.h.

## ◆ intended_railtypes

RailTypes RailVehicleInfo::intended_railtypes {RAILTYPE_RAIL}

Intended railtypes, regardless of elrail being enabled or disabled.

Definition at line 79 of file engine_type.h.

## ◆ max_speed

uint16_t RailVehicleInfo::max_speed = 0

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

Definition at line 81 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 88 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 89 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 82 of file engine_type.h.

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

## ◆ railtypes

RailTypes RailVehicleInfo::railtypes {RAILTYPE_RAIL}

Railtypes, mangled if elrail is disabled.

Definition at line 78 of file engine_type.h.

Referenced by AfterLoadGame(), CheckAutoreplaceValidity(), CmdBuildRailVehicle(), CmdBuildRailWagon(), Train::ConsistChanged(), ReplaceVehicleWindow::GenerateReplaceRailList(), GetCompanyRailTypes(), GetEngineCategoryName(), GetRailTypes(), IsEngineBuildable(), and NewVehicleAvailable().

## ◆ railveh_type

RailVehicleTypes RailVehicleInfo::railveh_type = RAILVEH_WAGON

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

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

## ◆ running_cost_class

Price RailVehicleInfo::running_cost_class {}

Definition at line 85 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 91 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 92 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 94 of file engine_type.h.

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

## ◆ visual_effect

uint8_t RailVehicleInfo::visual_effect = VE_DEFAULT

Bitstuffed NewGRF visual effect data.

Definition at line 90 of file engine_type.h.

Referenced by RailVehicleChangeInfo().

## ◆ weight

uint16_t RailVehicleInfo::weight = 0

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

Definition at line 83 of file engine_type.h.

Referenced by RailVehicleChangeInfo().

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

- src/engine_type.h