author | truebrain |
Fri, 13 Jun 2008 19:12:55 +0000 | |
branch | noai |
changeset 10956 | 82aa600a9922 |
parent 10867 | 5de2923d6e59 |
permissions | -rw-r--r-- |
9837 | 1 |
/* $Id$ */ |
2 |
||
3 |
/** @file engine_type.h Types related to engines. */ |
|
4 |
||
5 |
#ifndef ENGINE_TYPE_H |
|
6 |
#define ENGINE_TYPE_H |
|
7 |
||
8 |
#include "rail_type.h" |
|
9 |
#include "cargo_type.h" |
|
10 |
#include "vehicle_type.h" |
|
11 |
#include "gfx_type.h" |
|
12 |
#include "date_type.h" |
|
13 |
#include "sound_type.h" |
|
14 |
#include "player_type.h" |
|
15 |
#include "strings_type.h" |
|
16 |
||
17 |
typedef uint16 EngineID; |
|
18 |
typedef uint16 EngineRenewID; |
|
10455
22c441f5adf9
(svn r12997) [NoAI] -Sync: with trunk r12895:12996.
rubidium
parents:
9837
diff
changeset
|
19 |
|
22c441f5adf9
(svn r12997) [NoAI] -Sync: with trunk r12895:12996.
rubidium
parents:
9837
diff
changeset
|
20 |
struct Engine; |
9837 | 21 |
|
22 |
enum RailVehicleTypes { |
|
23 |
RAILVEH_SINGLEHEAD, ///< indicates a "standalone" locomotive |
|
24 |
RAILVEH_MULTIHEAD, ///< indicates a combination of two locomotives |
|
25 |
RAILVEH_WAGON, ///< simple wagon, not motorized |
|
26 |
}; |
|
27 |
||
28 |
enum EngineClass { |
|
29 |
EC_STEAM, |
|
30 |
EC_DIESEL, |
|
31 |
EC_ELECTRIC, |
|
32 |
EC_MONORAIL, |
|
33 |
EC_MAGLEV, |
|
34 |
}; |
|
35 |
||
36 |
struct RailVehicleInfo { |
|
37 |
byte image_index; |
|
38 |
RailVehicleTypes railveh_type; |
|
39 |
byte base_cost; |
|
40 |
RailTypeByte railtype; |
|
41 |
uint16 max_speed; |
|
42 |
uint16 power; |
|
43 |
uint16 weight; |
|
44 |
byte running_cost; |
|
45 |
byte running_cost_class; |
|
46 |
EngineClass engclass; ///< Class of engine for this vehicle |
|
47 |
byte capacity; |
|
48 |
CargoID cargo_type; |
|
49 |
byte ai_rank; |
|
50 |
byte ai_passenger_only; ///< Bit value to tell AI that this engine is for passenger use only |
|
51 |
uint16 pow_wag_power; |
|
52 |
byte pow_wag_weight; |
|
53 |
byte visual_effect; // NOTE: this is not 100% implemented yet, at the moment it is only used as a 'fallback' value |
|
54 |
// for when the 'powered wagon' callback fails. But it should really also determine what |
|
55 |
// kind of visual effect to generate for a vehicle (default, steam, diesel, electric). |
|
56 |
// Same goes for the callback result, which atm is only used to check if a wagon is powered. |
|
57 |
byte shorten_factor; ///< length on main map for this type is 8 - shorten_factor |
|
58 |
byte tractive_effort; ///< Tractive effort coefficient |
|
59 |
byte user_def_data; ///< Property 0x25: "User-defined bit mask" Used only for (very few) NewGRF vehicles |
|
60 |
}; |
|
61 |
||
62 |
struct ShipVehicleInfo { |
|
63 |
byte image_index; |
|
64 |
byte base_cost; |
|
65 |
uint16 max_speed; |
|
66 |
CargoID cargo_type; |
|
67 |
uint16 capacity; |
|
68 |
byte running_cost; |
|
69 |
SoundFxByte sfx; |
|
70 |
bool refittable; |
|
71 |
}; |
|
72 |
||
73 |
/* AircraftVehicleInfo subtypes, bitmask type. |
|
74 |
* If bit 0 is 0 then it is a helicopter, otherwise it is a plane |
|
75 |
* in which case bit 1 tells us whether it's a big(fast) plane or not */ |
|
76 |
enum { |
|
77 |
AIR_HELI = 0, |
|
78 |
AIR_CTOL = 1, ///< Conventional Take Off and Landing, i.e. planes |
|
79 |
AIR_FAST = 2 |
|
80 |
}; |
|
81 |
||
82 |
struct AircraftVehicleInfo { |
|
83 |
byte image_index; |
|
84 |
byte base_cost; |
|
85 |
byte running_cost; |
|
86 |
byte subtype; |
|
87 |
SoundFxByte sfx; |
|
88 |
byte acceleration; |
|
89 |
uint16 max_speed; |
|
90 |
byte mail_capacity; |
|
91 |
uint16 passenger_capacity; |
|
92 |
}; |
|
93 |
||
94 |
struct RoadVehicleInfo { |
|
95 |
byte image_index; |
|
96 |
byte base_cost; |
|
97 |
byte running_cost; |
|
98 |
byte running_cost_class; |
|
99 |
SoundFxByte sfx; |
|
100 |
byte max_speed; |
|
101 |
byte capacity; |
|
102 |
CargoID cargo_type; |
|
103 |
}; |
|
104 |
||
105 |
/** Information about a vehicle |
|
106 |
* @see table/engines.h |
|
107 |
*/ |
|
108 |
struct EngineInfo { |
|
109 |
Date base_intro; |
|
110 |
Year lifelength; |
|
111 |
Year base_life; |
|
10867
5de2923d6e59
(svn r13418) [NoAI] -Sync: with trunk r13380:13417.
rubidium
parents:
10776
diff
changeset
|
112 |
byte decay_speed; |
9837 | 113 |
byte load_amount; |
114 |
byte climates; |
|
115 |
uint32 refit_mask; |
|
116 |
byte refit_cost; |
|
117 |
byte misc_flags; |
|
118 |
byte callbackmask; |
|
119 |
int8 retire_early; ///< Number of years early to retire vehicle |
|
120 |
StringID string_id; ///< Default name of engine |
|
121 |
}; |
|
122 |
||
123 |
/** |
|
124 |
* EngineInfo.misc_flags is a bitmask, with the following values |
|
125 |
*/ |
|
126 |
enum { |
|
127 |
EF_RAIL_TILTS = 0, ///< Rail vehicle tilts in curves |
|
128 |
EF_ROAD_TRAM = 0, ///< Road vehicle is a tram/light rail vehicle |
|
129 |
EF_USES_2CC = 1, ///< Vehicle uses two company colours |
|
130 |
EF_RAIL_IS_MU = 2, ///< Rail vehicle is a multiple-unit (DMU/EMU) |
|
131 |
}; |
|
132 |
||
133 |
/** |
|
134 |
* Engine.flags is a bitmask, with the following values. |
|
135 |
*/ |
|
136 |
enum { |
|
137 |
ENGINE_AVAILABLE = 1, ///< This vehicle is available to everyone. |
|
138 |
ENGINE_EXCLUSIVE_PREVIEW = 2, ///< This vehicle is in the exclusive preview stage, either being used or being offered to a player. |
|
139 |
ENGINE_OFFER_WINDOW_OPEN = 4, ///< The exclusive offer window is currently open for a player. |
|
140 |
}; |
|
141 |
||
142 |
enum { |
|
143 |
NUM_VEHICLE_TYPES = 6 |
|
144 |
}; |
|
145 |
||
146 |
static const EngineID INVALID_ENGINE = 0xFFFF; |
|
147 |
||
148 |
#endif /* ENGINE_TYPE_H */ |