annotate src/engine_type.h @ 12778:bc7926153e19 draft

(svn r17248) -Fix: add GPL license notice where appropriate
author rubidium <rubidium@openttd.org>
date Fri, 21 Aug 2009 20:21:05 +0000
parents a6c968c2d429
children 8e2a0e8fa275
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
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
15 #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
16 #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
17 #include "vehicle_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 "gfx_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 "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
20 #include "sound_type.h"
10208
39cf8eebfda5 (svn r14422) -Codechange: also reflect the changes of r14421 in the filenames.
rubidium <rubidium@openttd.org>
parents: 10207
diff changeset
21 #include "company_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
22 #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
23
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
24 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
25
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
26 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
27
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
28 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
29 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
30 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
31 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
32 };
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
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 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
35 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
36 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
37 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
38 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
39 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
40 };
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
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 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
43 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
44 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
45 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
46 RailTypeByte railtype;
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
47 uint16 max_speed;
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 uint16 power; ///< Power of engine; For multiheaded engines the sum of both engine powers.
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
49 uint16 weight; ///< Weight of vehicle; For multiheaded engines the weight of each single engine.
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
50 byte running_cost; ///< Running cost of engine; For multiheaded engines the sum of both running costs.
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
51 byte running_cost_class;
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
52 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
53 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
54 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
55 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
56 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
57 byte visual_effect; ///< Bitstuffed NewGRF visual effect data
7137f60c0fd3 (svn r15845) -Fix: Ancient comments
peter1138 <peter1138@openttd.org>
parents: 10982
diff changeset
58 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
59 byte tractive_effort; ///< Tractive effort coefficient
7137f60c0fd3 (svn r15845) -Fix: Ancient comments
peter1138 <peter1138@openttd.org>
parents: 10982
diff changeset
60 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
61 };
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
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
63 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
64 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
65 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
66 uint16 max_speed;
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
67 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
68 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
69 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
70 bool refittable;
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 };
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
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 /* 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
74 * 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
75 * in which case bit 1 tells us whether it's a big(fast) plane or not */
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 enum {
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_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
78 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
79 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
80 };
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
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
82 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
83 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
84 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
85 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
86 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
87 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
88 byte acceleration;
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 max_speed;
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 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
91 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
92 };
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
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
94 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
95 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
96 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
97 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
98 byte 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
99 SoundID sfx;
10595
0981f4793872 (svn r14869) -Feature: Allow road vehicles to move multiple steps in a tick (code based on train movement code) and add support for RV prop 15. This gives RVs a maximum speed of 318mph instead 79mph. This only implements higher speeds, not 'realistic acceleration'.
peter1138 <peter1138@openttd.org>
parents: 10208
diff changeset
100 uint16 max_speed; ///< Maximum speed in mph/3.2 units
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
101 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
102 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
103 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
104 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
105 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
106 };
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
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 /** 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
109 * @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
110 */
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
111 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
112 Date base_intro;
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
113 Year lifelength;
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 Year base_life;
9468
07d40eb8252e (svn r13388) -Codechange: Remove "my invented flag for something that is a wagon"
peter1138 <peter1138@openttd.org>
parents: 9380
diff changeset
115 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
116 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
117 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
118 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
119 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
120 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
121 byte misc_flags;
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 byte callbackmask;
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 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
124 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
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
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 /**
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
128 * 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
129 */
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 enum {
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_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
132 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
133 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
134 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
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
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 /**
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
138 * 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
139 */
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
140 enum {
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
141 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
142 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
143 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
144 };
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
145
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
146 enum {
9913
a1cc2bf90049 (svn r14063) -Codechange: replace some "magic" constants with enumified constants.
rubidium <rubidium@openttd.org>
parents: 9720
diff changeset
147 NUM_VEHICLE_TYPES = 6,
a1cc2bf90049 (svn r14063) -Codechange: replace some "magic" constants with enumified constants.
rubidium <rubidium@openttd.org>
parents: 9720
diff changeset
148 MAX_LENGTH_ENGINE_NAME_BYTES = 31, ///< The maximum length of an engine name in bytes including '\0'
a1cc2bf90049 (svn r14063) -Codechange: replace some "magic" constants with enumified constants.
rubidium <rubidium@openttd.org>
parents: 9720
diff changeset
149 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
150 };
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
151
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
152 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
153
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
154 #endif /* ENGINE_TYPE_H */