OpenTTD Source: GRFTempEngineData Struct Reference

OpenTTD Source 15.3

Public Types | Public Member Functions | Data Fields
GRFTempEngineData Struct Reference

Temporary engine data used when loading only. More...

`#include <newgrf_internal_vehicle.h>`

## Public Types
enum | Refittability : uint8_t { UNSET = 0 , EMPTY , NONEMPTY }
| Summary state of refittability properties. More...

## Public Member Functions
void | UpdateRefittability (bool non_empty)
| Update the summary refittability on setting a refittability property.

## Data Fields
CargoClasses | cargo_allowed
| Bitmask of cargo classes that are allowed as a refit.
CargoClasses | cargo_allowed_required
| Bitmask of cargo classes that are required to be all present to allow a cargo as a refit.
CargoClasses | cargo_disallowed
| Bitmask of cargo classes that are disallowed as a refit.
std::vector< RailTypeLabel > | railtypelabels
uint8_t | roadtramtype
const GRFFile * | defaultcargo_grf
| GRF defining the cargo translation table to use if the default cargo is the 'first refittable'.
Refittability | refittability
| Did the newgrf set any refittability property? If not, default refittability will be applied.
uint8_t | rv_max_speed
| Temporary storage of RV prop 15, maximum speed in mph/0.8.
CargoTypes | ctt_include_mask
| Cargo types always included in the refit mask.
CargoTypes | ctt_exclude_mask
| Cargo types always excluded from the refit mask.

## Detailed Description

Temporary engine data used when loading only.

Definition at line 19 of file newgrf_internal_vehicle.h.

## Member Enumeration Documentation

## ◆ Refittability

enum GRFTempEngineData::Refittability : uint8_t

Summary state of refittability properties.

Enumerator
UNSET | No properties assigned. Default refit masks shall be activated.
EMPTY | GRF defined vehicle as not-refittable. The vehicle shall only carry the default cargo.
NONEMPTY | GRF defined the vehicle as refittable. If the refitmask is empty after translation (cargotypes not available), disable the vehicle.

Definition at line 21 of file newgrf_internal_vehicle.h.

## Member Function Documentation

## ◆ UpdateRefittability()

void GRFTempEngineData::UpdateRefittability | ( | bool | non_empty | ) |
| inline

Update the summary refittability on setting a refittability property.

Parameters

  non_empty | true if the GRF sets the vehicle to be refittable.

Definition at line 42 of file newgrf_internal_vehicle.h.

References EMPTY, NONEMPTY, and UNSET.

## Field Documentation

## ◆ cargo_allowed

CargoClasses GRFTempEngineData::cargo_allowed

Bitmask of cargo classes that are allowed as a refit.

Definition at line 27 of file newgrf_internal_vehicle.h.

## ◆ cargo_allowed_required

CargoClasses GRFTempEngineData::cargo_allowed_required

Bitmask of cargo classes that are required to be all present to allow a cargo as a refit.

Definition at line 28 of file newgrf_internal_vehicle.h.

## ◆ cargo_disallowed

CargoClasses GRFTempEngineData::cargo_disallowed

Bitmask of cargo classes that are disallowed as a refit.

Definition at line 29 of file newgrf_internal_vehicle.h.

## ◆ ctt_exclude_mask

CargoTypes GRFTempEngineData::ctt_exclude_mask

Cargo types always excluded from the refit mask.

Definition at line 36 of file newgrf_internal_vehicle.h.

## ◆ ctt_include_mask

CargoTypes GRFTempEngineData::ctt_include_mask

Cargo types always included in the refit mask.

Definition at line 35 of file newgrf_internal_vehicle.h.

## ◆ defaultcargo_grf

const GRFFile* GRFTempEngineData::defaultcargo_grf

GRF defining the cargo translation table to use if the default cargo is the 'first refittable'.

Definition at line 32 of file newgrf_internal_vehicle.h.

## ◆ railtypelabels

std::vector<RailTypeLabel> GRFTempEngineData::railtypelabels

Definition at line 30 of file newgrf_internal_vehicle.h.

## ◆ refittability

Refittability GRFTempEngineData::refittability

Did the newgrf set any refittability property? If not, default refittability will be applied.

Definition at line 33 of file newgrf_internal_vehicle.h.

## ◆ roadtramtype

uint8_t GRFTempEngineData::roadtramtype

Definition at line 31 of file newgrf_internal_vehicle.h.

## ◆ rv_max_speed

uint8_t GRFTempEngineData::rv_max_speed

Temporary storage of RV prop 15, maximum speed in mph/0.8.

Definition at line 34 of file newgrf_internal_vehicle.h.

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

- src/newgrf/newgrf_internal_vehicle.h