annotate src/engine_type.h @ 15308:73d4675b5be0 draft

(svn r19949) -Doc: Mention tricky units (like speed) more often and more consistently.
author frosch <frosch@openttd.org>
date Tue, 08 Jun 2010 20:16:51 +0000
parents 43a5d37b45c4
children f8e9a3f0c140
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8777
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
1 /* $Id$ */
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
2
12778
bc7926153e19 (svn r17248) -Fix: add GPL license notice where appropriate
rubidium <rubidium@openttd.org>
parents: 12745
diff changeset
3 /*
bc7926153e19 (svn r17248) -Fix: add GPL license notice where appropriate
rubidium <rubidium@openttd.org>
parents: 12745
diff changeset
4 * This file is part of OpenTTD.
bc7926153e19 (svn r17248) -Fix: add GPL license notice where appropriate
rubidium <rubidium@openttd.org>
parents: 12745
diff changeset
5 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
bc7926153e19 (svn r17248) -Fix: add GPL license notice where appropriate
rubidium <rubidium@openttd.org>
parents: 12745
diff changeset
6 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
bc7926153e19 (svn r17248) -Fix: add GPL license notice where appropriate
rubidium <rubidium@openttd.org>
parents: 12745
diff changeset
7 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
bc7926153e19 (svn r17248) -Fix: add GPL license notice where appropriate
rubidium <rubidium@openttd.org>
parents: 12745
diff changeset
8 */
bc7926153e19 (svn r17248) -Fix: add GPL license notice where appropriate
rubidium <rubidium@openttd.org>
parents: 12745
diff changeset
9
8777
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
10 /** @file engine_type.h Types related to engines. */
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
11
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
12 #ifndef ENGINE_TYPE_H
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
13 #define ENGINE_TYPE_H
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
14
13486
f2535c5098a0 (svn r18005) -Codechange: Convert the Prices struct into an array and an enum.
frosch <frosch@openttd.org>
parents: 13193
diff changeset
15 #include "economy_type.h"
8777
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
16 #include "rail_type.h"
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
17 #include "cargo_type.h"
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
18 #include "date_type.h"
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
19 #include "sound_type.h"
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
20 #include "strings_type.h"
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
21
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
22 typedef uint16 EngineID;
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
23
9070
11b5b3f4175d (svn r12924) -Feature: Introducing the so called 'engine pool' which primarily removes the fixed engine type limits and also happens to allow (with the patch option 'dynamic_engines') multiple NewGRF vehicle sets to coexist.
peter1138 <peter1138@openttd.org>
parents: 8777
diff changeset
24 struct Engine;
11b5b3f4175d (svn r12924) -Feature: Introducing the so called 'engine pool' which primarily removes the fixed engine type limits and also happens to allow (with the patch option 'dynamic_engines') multiple NewGRF vehicle sets to coexist.
peter1138 <peter1138@openttd.org>
parents: 8777
diff changeset
25
8777
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
26 enum RailVehicleTypes {
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
27 RAILVEH_SINGLEHEAD, ///< indicates a "standalone" locomotive
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
28 RAILVEH_MULTIHEAD, ///< indicates a combination of two locomotives
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
29 RAILVEH_WAGON, ///< simple wagon, not motorized
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
30 };
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
31
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
32 enum EngineClass {
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
33 EC_STEAM,
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
34 EC_DIESEL,
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
35 EC_ELECTRIC,
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
36 EC_MONORAIL,
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
37 EC_MAGLEV,
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
38 };
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
39
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
40 struct RailVehicleInfo {
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
41 byte image_index;
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
42 RailVehicleTypes railveh_type;
9923
82b94a0a3f6c (svn r14078) -Codechange: Rename *VehicleInfo::base_cost to cost_factor, indicating what it actually is.
peter1138 <peter1138@openttd.org>
parents: 9913
diff changeset
43 byte cost_factor; ///< Purchase cost factor; For multiheaded engines the sum of both engine prices.
8777
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
44 RailTypeByte railtype;
15308
73d4675b5be0 (svn r19949) -Doc: Mention tricky units (like speed) more often and more consistently.
frosch <frosch@openttd.org>
parents: 15183
diff changeset
45 uint16 max_speed; ///< Maximum speed (1 unit = 1/1.6 mph = 1 km-ish/h)
73d4675b5be0 (svn r19949) -Doc: Mention tricky units (like speed) more often and more consistently.
frosch <frosch@openttd.org>
parents: 15183
diff changeset
46 uint16 power; ///< Power of engine (hp); For multiheaded engines the sum of both engine powers.
73d4675b5be0 (svn r19949) -Doc: Mention tricky units (like speed) more often and more consistently.
frosch <frosch@openttd.org>
parents: 15183
diff changeset
47 uint16 weight; ///< Weight of vehicle (tons); For multiheaded engines the weight of each single engine.
9720
7aa78e4bca3d (svn r13844) -Fix (r13074, r13591): Power, running cost and capacity of multiheaded engines were (too often) doubled in newspaper resp. offer window.
frosch <frosch@openttd.org>
parents: 9468
diff changeset
48 byte running_cost; ///< Running cost of engine; For multiheaded engines the sum of both running costs.
13486
f2535c5098a0 (svn r18005) -Codechange: Convert the Prices struct into an array and an enum.
frosch <frosch@openttd.org>
parents: 13193
diff changeset
49 Price running_cost_class;
8777
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
50 EngineClass engclass; ///< Class of engine for this vehicle
9720
7aa78e4bca3d (svn r13844) -Fix (r13074, r13591): Power, running cost and capacity of multiheaded engines were (too often) doubled in newspaper resp. offer window.
frosch <frosch@openttd.org>
parents: 9468
diff changeset
51 byte capacity; ///< Cargo capacity of vehicle; For multiheaded engines the capacity of each single engine.
11484
7137f60c0fd3 (svn r15845) -Fix: Ancient comments
peter1138 <peter1138@openttd.org>
parents: 10982
diff changeset
52 byte ai_passenger_only; ///< Bit value to tell AI that this engine is for passenger use only
7137f60c0fd3 (svn r15845) -Fix: Ancient comments
peter1138 <peter1138@openttd.org>
parents: 10982
diff changeset
53 uint16 pow_wag_power; ///< Extra power applied to consist if wagon should be powered
7137f60c0fd3 (svn r15845) -Fix: Ancient comments
peter1138 <peter1138@openttd.org>
parents: 10982
diff changeset
54 byte pow_wag_weight; ///< Extra weight applied to consist if wagon should be powered
7137f60c0fd3 (svn r15845) -Fix: Ancient comments
peter1138 <peter1138@openttd.org>
parents: 10982
diff changeset
55 byte visual_effect; ///< Bitstuffed NewGRF visual effect data
7137f60c0fd3 (svn r15845) -Fix: Ancient comments
peter1138 <peter1138@openttd.org>
parents: 10982
diff changeset
56 byte shorten_factor; ///< length on main map for this type is 8 - shorten_factor
7137f60c0fd3 (svn r15845) -Fix: Ancient comments
peter1138 <peter1138@openttd.org>
parents: 10982
diff changeset
57 byte tractive_effort; ///< Tractive effort coefficient
7137f60c0fd3 (svn r15845) -Fix: Ancient comments
peter1138 <peter1138@openttd.org>
parents: 10982
diff changeset
58 byte user_def_data; ///< Property 0x25: "User-defined bit mask" Used only for (very few) NewGRF vehicles
8777
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
59 };
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
60
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
61 struct ShipVehicleInfo {
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
62 byte image_index;
9923
82b94a0a3f6c (svn r14078) -Codechange: Rename *VehicleInfo::base_cost to cost_factor, indicating what it actually is.
peter1138 <peter1138@openttd.org>
parents: 9913
diff changeset
63 byte cost_factor;
15308
73d4675b5be0 (svn r19949) -Doc: Mention tricky units (like speed) more often and more consistently.
frosch <frosch@openttd.org>
parents: 15183
diff changeset
64 uint16 max_speed; ///< Maximum speed (1 unit = 1/3.2 mph = 0.5 km-ish/h)
8777
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
65 uint16 capacity;
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
66 byte running_cost;
11937
58cf1ef548bb (svn r16340) -Codechange: introduce SoundID (uint16) and use that instead of SoundFX, which was used as a byte and uint16 at different places, when the uint16 sound ID is meant.
rubidium <rubidium@openttd.org>
parents: 11484
diff changeset
67 SoundID sfx;
13193
2586b22e6f53 (svn r17700) -Codechange: Integrate ShipVehicleInfo::refittable into EngineInfo::refit_mask during initialisation.
frosch <frosch@openttd.org>
parents: 13036
diff changeset
68 bool old_refittable; ///< Is ship refittable; only used during initialisation. Later use EngineInfo::refit_mask.
8777
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
69 };
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
70
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
71 /* AircraftVehicleInfo subtypes, bitmask type.
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
72 * If bit 0 is 0 then it is a helicopter, otherwise it is a plane
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
73 * in which case bit 1 tells us whether it's a big(fast) plane or not */
15183
43a5d37b45c4 (svn r19812) -Codechange: give some unnamed enums a name or, in case they consisted of unrelated values use static const (u)int
rubidium <rubidium@openttd.org>
parents: 14258
diff changeset
74 enum AircraftSubTypeBits {
8777
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
75 AIR_HELI = 0,
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
76 AIR_CTOL = 1, ///< Conventional Take Off and Landing, i.e. planes
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
77 AIR_FAST = 2
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
78 };
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
79
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
80 struct AircraftVehicleInfo {
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
81 byte image_index;
9923
82b94a0a3f6c (svn r14078) -Codechange: Rename *VehicleInfo::base_cost to cost_factor, indicating what it actually is.
peter1138 <peter1138@openttd.org>
parents: 9913
diff changeset
82 byte cost_factor;
8777
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
83 byte running_cost;
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
84 byte subtype;
11937
58cf1ef548bb (svn r16340) -Codechange: introduce SoundID (uint16) and use that instead of SoundFX, which was used as a byte and uint16 at different places, when the uint16 sound ID is meant.
rubidium <rubidium@openttd.org>
parents: 11484
diff changeset
85 SoundID sfx;
8777
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
86 byte acceleration;
15308
73d4675b5be0 (svn r19949) -Doc: Mention tricky units (like speed) more often and more consistently.
frosch <frosch@openttd.org>
parents: 15183
diff changeset
87 uint16 max_speed; ///< Maximum speed (1 unit = 8 mph = 12.8 km-ish/h)
8777
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
88 byte mail_capacity;
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
89 uint16 passenger_capacity;
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
90 };
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
91
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
92 struct RoadVehicleInfo {
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
93 byte image_index;
9923
82b94a0a3f6c (svn r14078) -Codechange: Rename *VehicleInfo::base_cost to cost_factor, indicating what it actually is.
peter1138 <peter1138@openttd.org>
parents: 9913
diff changeset
94 byte cost_factor;
8777
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
95 byte running_cost;
13486
f2535c5098a0 (svn r18005) -Codechange: Convert the Prices struct into an array and an enum.
frosch <frosch@openttd.org>
parents: 13193
diff changeset
96 Price running_cost_class;
11937
58cf1ef548bb (svn r16340) -Codechange: introduce SoundID (uint16) and use that instead of SoundFX, which was used as a byte and uint16 at different places, when the uint16 sound ID is meant.
rubidium <rubidium@openttd.org>
parents: 11484
diff changeset
97 SoundID sfx;
15308
73d4675b5be0 (svn r19949) -Doc: Mention tricky units (like speed) more often and more consistently.
frosch <frosch@openttd.org>
parents: 15183
diff changeset
98 uint16 max_speed; ///< Maximum speed (1 unit = 1/3.2 mph = 0.5 km-ish/h)
8777
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
99 byte capacity;
10982
bb9f7c744e3b (svn r15321) -Codechange: Load road vehicle 'realistic' acceleration properties from NewGRF, and supply defaults as used by TTDPatch. These values are not yet used.
peter1138 <peter1138@openttd.org>
parents: 10595
diff changeset
100 uint8 weight; ///< Weight in 1/4t units
bb9f7c744e3b (svn r15321) -Codechange: Load road vehicle 'realistic' acceleration properties from NewGRF, and supply defaults as used by TTDPatch. These values are not yet used.
peter1138 <peter1138@openttd.org>
parents: 10595
diff changeset
101 uint8 power; ///< Power in 10hp units
bb9f7c744e3b (svn r15321) -Codechange: Load road vehicle 'realistic' acceleration properties from NewGRF, and supply defaults as used by TTDPatch. These values are not yet used.
peter1138 <peter1138@openttd.org>
parents: 10595
diff changeset
102 uint8 tractive_effort; ///< Coefficient of tractive effort
bb9f7c744e3b (svn r15321) -Codechange: Load road vehicle 'realistic' acceleration properties from NewGRF, and supply defaults as used by TTDPatch. These values are not yet used.
peter1138 <peter1138@openttd.org>
parents: 10595
diff changeset
103 uint8 air_drag; ///< Coefficient of air drag
8777
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
104 };
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
105
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
106 /** Information about a vehicle
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
107 * @see table/engines.h
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
108 */
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
109 struct EngineInfo {
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
110 Date base_intro;
15308
73d4675b5be0 (svn r19949) -Doc: Mention tricky units (like speed) more often and more consistently.
frosch <frosch@openttd.org>
parents: 15183
diff changeset
111 Year lifelength; ///< Lifetime of a single vehicle
73d4675b5be0 (svn r19949) -Doc: Mention tricky units (like speed) more often and more consistently.
frosch <frosch@openttd.org>
parents: 15183
diff changeset
112 Year base_life; ///< Basic duration of engine availability (without random parts)
9468
07d40eb8252e (svn r13388) -Codechange: Remove "my invented flag for something that is a wagon"
peter1138 <peter1138@openttd.org>
parents: 9380
diff changeset
113 byte decay_speed;
8777
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
114 byte load_amount;
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
115 byte climates;
12743
794d48beec53 (svn r17209) -Codechange: Move cargo_type from (Rail|Road|Ship)VehicleInfo to EngineInfo.
frosch <frosch@openttd.org>
parents: 11937
diff changeset
116 CargoID cargo_type;
8777
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
117 uint32 refit_mask;
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
118 byte refit_cost;
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
119 byte misc_flags;
13036
8e2a0e8fa275 (svn r17534) -Codechange: unify the naming of callback masks/flags
rubidium <rubidium@openttd.org>
parents: 12778
diff changeset
120 byte callback_mask; ///< Bitmask of vehicle callbacks that have to be called
8777
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
121 int8 retire_early; ///< Number of years early to retire vehicle
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
122 StringID string_id; ///< Default name of engine
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
123 };
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
124
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
125 /**
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
126 * EngineInfo.misc_flags is a bitmask, with the following values
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
127 */
15183
43a5d37b45c4 (svn r19812) -Codechange: give some unnamed enums a name or, in case they consisted of unrelated values use static const (u)int
rubidium <rubidium@openttd.org>
parents: 14258
diff changeset
128 enum EngineMiscFlags {
8777
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
129 EF_RAIL_TILTS = 0, ///< Rail vehicle tilts in curves
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
130 EF_ROAD_TRAM = 0, ///< Road vehicle is a tram/light rail vehicle
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
131 EF_USES_2CC = 1, ///< Vehicle uses two company colours
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
132 EF_RAIL_IS_MU = 2, ///< Rail vehicle is a multiple-unit (DMU/EMU)
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
133 };
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
134
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
135 /**
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
136 * Engine.flags is a bitmask, with the following values.
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
137 */
15183
43a5d37b45c4 (svn r19812) -Codechange: give some unnamed enums a name or, in case they consisted of unrelated values use static const (u)int
rubidium <rubidium@openttd.org>
parents: 14258
diff changeset
138 enum EngineFlags {
8777
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
139 ENGINE_AVAILABLE = 1, ///< This vehicle is available to everyone.
10207
c54d140df948 (svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium <rubidium@openttd.org>
parents: 10127
diff changeset
140 ENGINE_EXCLUSIVE_PREVIEW = 2, ///< This vehicle is in the exclusive preview stage, either being used or being offered to a company.
c54d140df948 (svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
rubidium <rubidium@openttd.org>
parents: 10127
diff changeset
141 ENGINE_OFFER_WINDOW_OPEN = 4, ///< The exclusive offer window is currently open for a company.
8777
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
142 };
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
143
15183
43a5d37b45c4 (svn r19812) -Codechange: give some unnamed enums a name or, in case they consisted of unrelated values use static const (u)int
rubidium <rubidium@openttd.org>
parents: 14258
diff changeset
144 static const uint NUM_VEHICLE_TYPES = 6;
43a5d37b45c4 (svn r19812) -Codechange: give some unnamed enums a name or, in case they consisted of unrelated values use static const (u)int
rubidium <rubidium@openttd.org>
parents: 14258
diff changeset
145 static const uint MAX_LENGTH_ENGINE_NAME_BYTES = 31; ///< The maximum length of an engine name in bytes including '\0'
43a5d37b45c4 (svn r19812) -Codechange: give some unnamed enums a name or, in case they consisted of unrelated values use static const (u)int
rubidium <rubidium@openttd.org>
parents: 14258
diff changeset
146 static const uint MAX_LENGTH_ENGINE_NAME_PIXELS = 160; ///< The maximum length of an engine name in pixels
8777
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
147
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
148 static const EngineID INVALID_ENGINE = 0xFFFF;
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
149
b8c9838f0585 (svn r12476) -Codechange: split type engine related types from engine.h (and openttd.h) to engine_type.h.
rubidium <rubidium@openttd.org>
parents:
diff changeset
150 #endif /* ENGINE_TYPE_H */