1
/* $Id: engine_type.h 15321 2009-02-02 21:52:34Z peter1138 $ */
3
/** @file engine_type.h Types related to engines. */
9
#include "cargo_type.h"
10
#include "vehicle_type.h"
12
#include "date_type.h"
13
#include "sound_type.h"
14
#include "company_type.h"
15
#include "strings_type.h"
17
typedef uint16 EngineID;
21
enum RailVehicleTypes {
22
RAILVEH_SINGLEHEAD, ///< indicates a "standalone" locomotive
23
RAILVEH_MULTIHEAD, ///< indicates a combination of two locomotives
24
RAILVEH_WAGON, ///< simple wagon, not motorized
35
struct RailVehicleInfo {
37
RailVehicleTypes railveh_type;
38
byte cost_factor; ///< Purchase cost factor; For multiheaded engines the sum of both engine prices.
39
RailTypeByte railtype;
41
uint16 power; ///< Power of engine; For multiheaded engines the sum of both engine powers.
42
uint16 weight; ///< Weight of vehicle; For multiheaded engines the weight of each single engine.
43
byte running_cost; ///< Running cost of engine; For multiheaded engines the sum of both running costs.
44
byte running_cost_class;
45
EngineClass engclass; ///< Class of engine for this vehicle
46
byte capacity; ///< Cargo capacity of vehicle; For multiheaded engines the capacity of each single engine.
49
byte ai_passenger_only; ///< Bit value to tell AI that this engine is for passenger use only
52
byte visual_effect; // NOTE: this is not 100% implemented yet, at the moment it is only used as a 'fallback' value
53
// for when the 'powered wagon' callback fails. But it should really also determine what
54
// kind of visual effect to generate for a vehicle (default, steam, diesel, electric).
55
// Same goes for the callback result, which atm is only used to check if a wagon is powered.
56
byte shorten_factor; ///< length on main map for this type is 8 - shorten_factor
57
byte tractive_effort; ///< Tractive effort coefficient
58
byte user_def_data; ///< Property 0x25: "User-defined bit mask" Used only for (very few) NewGRF vehicles
61
struct ShipVehicleInfo {
72
/* AircraftVehicleInfo subtypes, bitmask type.
73
* If bit 0 is 0 then it is a helicopter, otherwise it is a plane
74
* in which case bit 1 tells us whether it's a big(fast) plane or not */
77
AIR_CTOL = 1, ///< Conventional Take Off and Landing, i.e. planes
81
struct AircraftVehicleInfo {
90
uint16 passenger_capacity;
93
struct RoadVehicleInfo {
97
byte running_cost_class;
99
uint16 max_speed; ///< Maximum speed in mph/3.2 units
102
uint8 weight; ///< Weight in 1/4t units
103
uint8 power; ///< Power in 10hp units
104
uint8 tractive_effort; ///< Coefficient of tractive effort
105
uint8 air_drag; ///< Coefficient of air drag
108
/** Information about a vehicle
109
* @see table/engines.h
122
int8 retire_early; ///< Number of years early to retire vehicle
123
StringID string_id; ///< Default name of engine
127
* EngineInfo.misc_flags is a bitmask, with the following values
130
EF_RAIL_TILTS = 0, ///< Rail vehicle tilts in curves
131
EF_ROAD_TRAM = 0, ///< Road vehicle is a tram/light rail vehicle
132
EF_USES_2CC = 1, ///< Vehicle uses two company colours
133
EF_RAIL_IS_MU = 2, ///< Rail vehicle is a multiple-unit (DMU/EMU)
137
* Engine.flags is a bitmask, with the following values.
140
ENGINE_AVAILABLE = 1, ///< This vehicle is available to everyone.
141
ENGINE_EXCLUSIVE_PREVIEW = 2, ///< This vehicle is in the exclusive preview stage, either being used or being offered to a company.
142
ENGINE_OFFER_WINDOW_OPEN = 4, ///< The exclusive offer window is currently open for a company.
146
NUM_VEHICLE_TYPES = 6,
147
MAX_LENGTH_ENGINE_NAME_BYTES = 31, ///< The maximum length of an engine name in bytes including '\0'
148
MAX_LENGTH_ENGINE_NAME_PIXELS = 160, ///< The maximum length of an engine name in pixels
151
static const EngineID INVALID_ENGINE = 0xFFFF;
153
#endif /* ENGINE_TYPE_H */