OpenTTD Source 20260711-master-g3fb3006dff
EngineIDMapping Struct Reference

Public Member Functions

uint64_t Key () const
 Create a 64 bit key from this mapping.
 EngineIDMapping ()
 Create a new mapping.
 EngineIDMapping (GrfID grfid, uint16_t internal_id, VehicleType type, uint8_t substitute_id, EngineID engine)
 Create the mapping.

Static Public Member Functions

static uint64_t Key (GrfID grfid, uint16_t internal_id)
 Create a 64 bit key from the GRFID and internal ID for mappings.

Data Fields

GrfID grfid {}
 The GRF ID of the file the entity belongs to.
uint16_t internal_id = 0
 The internal ID within the GRF file.
VehicleType type {}
 The engine type.
uint8_t substitute_id = 0
 The (original) entity ID to use if this GRF is not available (currently not used).
EngineID engine {}

Detailed Description

Definition at line 203 of file engine_base.h.

Constructor & Destructor Documentation

◆ EngineIDMapping() [1/2]

EngineIDMapping::EngineIDMapping ( )
inline

Create a new mapping.

Definition at line 225 of file engine_base.h.

◆ EngineIDMapping() [2/2]

EngineIDMapping::EngineIDMapping ( GrfID grfid,
uint16_t internal_id,
VehicleType type,
uint8_t substitute_id,
EngineID engine )
inline

Create the mapping.

Parameters
grfidThe unique identifer of the NewGRF.
internal_idThe internal identifier of the engine within the NewGRF.
typeThe vehicle type.
substitute_idThe original vehicle to fall back to.
engineThe engine the mapping is for.

Definition at line 235 of file engine_base.h.

References grfid, internal_id, substitute_id, and type.

Member Function Documentation

◆ Key() [1/2]

uint64_t EngineIDMapping::Key ( ) const
inline

Create a 64 bit key from this mapping.

Returns
The key.

Definition at line 222 of file engine_base.h.

References Key().

Referenced by EngineOverrideManager::GetID(), Key(), EngineOverrideManager::SetID(), and EngineOverrideManager::UseUnreservedID().

◆ Key() [2/2]

uint64_t EngineIDMapping::Key ( GrfID grfid,
uint16_t internal_id )
inlinestatic

Create a 64 bit key from the GRFID and internal ID for mappings.

Parameters
grfidThe NewGRF id.
internal_idThe internal ID within the GRF file.
Returns
The key.

Definition at line 216 of file engine_base.h.

References grfid, and internal_id.

Referenced by EngineOverrideManager::UseUnreservedID().

Field Documentation

◆ engine

EngineID EngineIDMapping::engine {}

Definition at line 208 of file engine_base.h.

◆ grfid

GrfID EngineIDMapping::grfid {}

The GRF ID of the file the entity belongs to.

Definition at line 204 of file engine_base.h.

Referenced by EngineIDMapping(), Key(), and EIDSChunkHandler::Load().

◆ internal_id

uint16_t EngineIDMapping::internal_id = 0

The internal ID within the GRF file.

Definition at line 205 of file engine_base.h.

Referenced by EngineIDMapping(), Key(), and EIDSChunkHandler::Load().

◆ substitute_id

uint8_t EngineIDMapping::substitute_id = 0

The (original) entity ID to use if this GRF is not available (currently not used).

Definition at line 207 of file engine_base.h.

Referenced by EngineIDMapping(), and EIDSChunkHandler::Load().

◆ type

VehicleType EngineIDMapping::type {}

The engine type.

Definition at line 206 of file engine_base.h.

Referenced by EngineIDMapping(), and EIDSChunkHandler::Load().


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