|
OpenTTD Source 15.0-beta1
|
Types related to engines. More...
#include "economy_type.h"#include "rail_type.h"#include "road_type.h"#include "cargo_type.h"#include "timer/timer_game_calendar.h"#include "sound_type.h"#include "strings_type.h"Go to the source code of this file.
Data Structures | |
| struct | RailVehicleInfo |
| Information about a rail vehicle. More... | |
| struct | ShipVehicleInfo |
| Information about a ship vehicle. More... | |
| struct | AircraftVehicleInfo |
| Information about a aircraft vehicle. More... | |
| struct | RoadVehicleInfo |
| Information about a road vehicle. More... | |
| struct | EngineInfo |
| Information about a vehicle. More... | |
Typedefs | |
| typedef uint16_t | EngineID |
| Unique identification number of an engine. | |
Enumerations | |
| enum | RailVehicleTypes : uint8_t { RAILVEH_SINGLEHEAD , RAILVEH_MULTIHEAD , RAILVEH_WAGON } |
| Available types of rail vehicles. More... | |
| enum | EngineClass : uint8_t { EC_STEAM , EC_DIESEL , EC_ELECTRIC , EC_MONORAIL , EC_MAGLEV } |
| Type of rail engine. More... | |
| enum | AircraftSubTypeBits { AIR_HELI = 0 , AIR_CTOL = 1 , AIR_FAST = 2 } |
| AircraftVehicleInfo subtypes, bitmask type. More... | |
| enum class | ExtraEngineFlags : uint16_t { None = 0 , NoNews = (1U << 0) , NoPreview = (1U << 1) , JoinPreview = (1U << 2) , SyncReliability = (1U << 3) } |
| Extra engine flags for NewGRF features. More... | |
| enum | EngineMiscFlags { EF_RAIL_TILTS = 0 , EF_ROAD_TRAM = 0 , EF_USES_2CC = 1 , EF_RAIL_IS_MU = 2 , EF_RAIL_FLIPS = 3 , EF_AUTO_REFIT = 4 , EF_NO_DEFAULT_CARGO_MULTIPLIER = 5 , EF_NO_BREAKDOWN_SMOKE = 6 , EF_SPRITE_STACK = 7 } |
| EngineInfo.misc_flags is a bitmask, with the following values. More... | |
| enum | EngineFlags { ENGINE_AVAILABLE = 1 , ENGINE_EXCLUSIVE_PREVIEW = 2 } |
| Engine.flags is a bitmask, with the following values. More... | |
| enum | EngineNameContext : uint8_t { Generic = 0x00 , VehicleDetails = 0x11 , PurchaseList = 0x20 , PreviewNews = 0x21 , AutoreplaceVehicleInUse = 0x22 } |
| Contexts an engine name can be shown in. More... | |
Functions | |
| DECLARE_ENUM_AS_BIT_SET (ExtraEngineFlags) | |
| uint64_t | PackEngineNameDParam (EngineID engine_id, EngineNameContext context, uint32_t extra_data=0) |
| Combine an engine ID and a name context to an engine name dparam. | |
Variables | |
| static const uint | MAX_LENGTH_ENGINE_NAME_CHARS = 32 |
| The maximum length of an engine name in characters including '\0'. | |
| static const EngineID | INVALID_ENGINE = 0xFFFF |
| Constant denoting an invalid engine. | |
Types related to engines.
Definition in file engine_type.h.
| typedef uint16_t EngineID |
Unique identification number of an engine.
Definition at line 21 of file engine_type.h.
| enum AircraftSubTypeBits |
AircraftVehicleInfo subtypes, bitmask type.
If bit 0 is 0 then it is a helicopter, otherwise it is a plane in which case bit 1 tells us whether it's a big(fast) plane or not.
| Enumerator | |
|---|---|
| AIR_CTOL | Conventional Take Off and Landing, i.e. planes. |
Definition at line 93 of file engine_type.h.
| enum EngineClass : uint8_t |
Type of rail engine.
| Enumerator | |
|---|---|
| EC_STEAM | Steam rail engine. |
| EC_DIESEL | Diesel rail engine. |
| EC_ELECTRIC | Electric rail engine. |
| EC_MONORAIL | Mono rail engine. |
| EC_MAGLEV | Maglev engine. |
Definition at line 33 of file engine_type.h.
| enum EngineFlags |
Engine.flags is a bitmask, with the following values.
| Enumerator | |
|---|---|
| ENGINE_AVAILABLE | This vehicle is available to everyone. |
| ENGINE_EXCLUSIVE_PREVIEW | This vehicle is in the exclusive preview stage, either being used or being offered to a company. |
Definition at line 186 of file engine_type.h.
| enum EngineMiscFlags |
EngineInfo.misc_flags is a bitmask, with the following values.
| Enumerator | |
|---|---|
| EF_RAIL_TILTS | Rail vehicle tilts in curves. |
| EF_ROAD_TRAM | Road vehicle is a tram/light rail vehicle. |
| EF_USES_2CC | Vehicle uses two company colours. |
| EF_RAIL_IS_MU | Rail vehicle is a multiple-unit (DMU/EMU) |
| EF_RAIL_FLIPS | Rail vehicle has old depot-flip handling. |
| EF_AUTO_REFIT | Automatic refitting is allowed. |
| EF_NO_DEFAULT_CARGO_MULTIPLIER | Use the new capacity algorithm. The default cargotype of the vehicle does not affect capacity multipliers. CB 15 is also called in purchase list. |
| EF_NO_BREAKDOWN_SMOKE | Do not show black smoke during a breakdown. |
| EF_SPRITE_STACK | Draw vehicle by stacking multiple sprites. |
Definition at line 171 of file engine_type.h.
| enum EngineNameContext : uint8_t |
Contexts an engine name can be shown in.
Definition at line 194 of file engine_type.h.
|
strong |
Extra engine flags for NewGRF features.
This is defined in the specification a 32 bit value, but most bits are not currently used.
| Enumerator | |
|---|---|
| NoNews | No 'new vehicle' news will be generated. |
| NoPreview | No exclusive preview will be offered. |
| JoinPreview | Engine will join exclusive preview with variant parent. |
| SyncReliability | Engine reliability will be synced with variant parent. |
Definition at line 135 of file engine_type.h.
| enum RailVehicleTypes : uint8_t |
Available types of rail vehicles.
| Enumerator | |
|---|---|
| RAILVEH_SINGLEHEAD | indicates a "standalone" locomotive |
| RAILVEH_MULTIHEAD | indicates a combination of two locomotives |
| RAILVEH_WAGON | simple wagon, not motorized |
Definition at line 26 of file engine_type.h.
|
inline |
Combine an engine ID and a name context to an engine name dparam.
Definition at line 203 of file engine_type.h.
Referenced by DrawAircraftDetails(), DrawEngineList(), DrawRoadVehDetails(), DrawShipDetails(), ReplaceVehicleWindow::DrawWidget(), EnginePreviewWindow::DrawWidget(), EngineNameSorter(), BuildVehicleWindow::FilterByText(), NewVehicleAvailable(), BuildVehicleWindow::OnClick(), and TrainDetailsInfoTab().
|
static |
Constant denoting an invalid engine.
Definition at line 210 of file engine_type.h.
Referenced by AddArticulatedParts(), BuildReplacementVehicle(), CalcEngineReliability(), CheckTrainAttachment(), CheckValidVehicles(), ClearLastVariant(), CmdAutoreplaceVehicle(), CmdBuildRailVehicle(), CmdBuildRailWagon(), CmdBuildRoadVehicle(), CmdSetAutoReplace(), CommitVehicleListOrderChanges(), Train::ConsistChanged(), CountArticulatedParts(), ReplaceVehicleWindow::DrawWidget(), EngineHasReplacementForCompany(), EngineReplacement(), BuildVehicleWindow::FilterEngineList(), FinaliseEngineArray(), ReplaceVehicleWindow::GenerateLists(), ReplaceVehicleWindow::GenerateReplaceVehList(), GetArticulatedRefitMasks(), GetCapacityOfArticulatedParts(), GetCargoTypesOfArticulatedParts(), Engine::GetDisplayVariant(), GetEngineLiveryScheme(), GetEnginePalette(), EngineOverrideManager::GetID(), GetNewEngine(), GetNewEngineType(), GetNextArticulatedPart(), GetVehiclePalette(), GUIEngineListAddChildren(), IsArticulatedVehicleRefittable(), Engine::IsVariantHidden(), LiveryHelper(), Vehicle::NeedsServicing(), ReplaceVehicleWindow::OnClick(), BuildVehicleWindow::OnClick(), ReplaceVehicleWindow::OnPaint(), BuildVehicleWindow::OnPaint(), RoadVehUpdateCache(), BuildVehicleWindow::SetStringParameters(), StartupOneEngine(), and EngineOverrideManager::UseUnreservedID().
|
static |
The maximum length of an engine name in characters including '\0'.
Definition at line 208 of file engine_type.h.
Referenced by CmdRenameEngine(), and BuildVehicleWindow::OnClick().