OpenTTD Source 20241224-master-gf74b0cf984
engine_base.h File Reference

Base class for engines. More...

#include "engine_type.h"
#include "vehicle_type.h"
#include "core/pool_type.hpp"
#include "newgrf_commons.h"
#include "timer/timer_game_calendar.h"

Go to the source code of this file.

Data Structures

struct  WagonOverride
 
struct  Engine
 
struct  Engine::EngineTypeFilter
 
struct  EngineIDMapping
 
struct  EngineIDMappingKeyProjection
 Projection to get a unique key of an EngineIDMapping, used for sorting in EngineOverrideManager. More...
 
struct  EngineOverrideManager
 Stores the mapping of EngineID to the internal id of newgrfs. More...
 

Typedefs

typedef Pool< Engine, EngineID, 64, 64000 > EnginePool
 

Enumerations

enum class  EngineDisplayFlags : uint8_t { None = 0 , HasVariants = (1U << 0) , IsFolded = (1U << 1) , Shaded = (1U << 2) }
 Flags used client-side in the purchase/autorenew engine list. More...
 

Functions

const EngineInfoEngInfo (EngineID e)
 
const RailVehicleInfoRailVehInfo (EngineID e)
 
const RoadVehicleInfoRoadVehInfo (EngineID e)
 
const ShipVehicleInfoShipVehInfo (EngineID e)
 
const AircraftVehicleInfoAircraftVehInfo (EngineID e)
 

Variables

EnginePool _engine_pool
 
EngineOverrideManager _engine_mngr
 

Detailed Description

Base class for engines.

Definition in file engine_base.h.

Typedef Documentation

◆ EnginePool

typedef Pool<Engine, EngineID, 64, 64000> EnginePool

Definition at line 34 of file engine_base.h.

Enumeration Type Documentation

◆ EngineDisplayFlags

enum class EngineDisplayFlags : uint8_t
strong

Flags used client-side in the purchase/autorenew engine list.

Enumerator
None 

No flag set.

HasVariants 

Set if engine has variants.

IsFolded 

Set if display of variants should be folded (hidden).

Shaded 

Set if engine should be masked.

Definition at line 26 of file engine_base.h.

Function Documentation

◆ AircraftVehInfo()

const AircraftVehicleInfo * AircraftVehInfo ( EngineID  e)
inline

Definition at line 254 of file engine_base.h.

◆ EngInfo()

const EngineInfo * EngInfo ( EngineID  e)
inline

Definition at line 234 of file engine_base.h.

◆ RailVehInfo()

const RailVehicleInfo * RailVehInfo ( EngineID  e)
inline

Definition at line 239 of file engine_base.h.

◆ RoadVehInfo()

const RoadVehicleInfo * RoadVehInfo ( EngineID  e)
inline

Definition at line 244 of file engine_base.h.

◆ ShipVehInfo()

const ShipVehicleInfo * ShipVehInfo ( EngineID  e)
inline

Definition at line 249 of file engine_base.h.

Variable Documentation

◆ _engine_mngr

EngineOverrideManager _engine_mngr
extern

Definition at line 45 of file engine.cpp.