OpenTTD

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

vehicle_type.h
Go to the documentation of this file.
1 /* $Id: vehicle_type.h 23080 2011-11-01 16:51:47Z frosch $ */
2
3 /*
4 * This file is part of OpenTTD.
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.
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.
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/>.
8 */
9
12 #ifndef VEHICLE_TYPE_H
13 #define VEHICLE_TYPE_H
14
15 #include "core/enum_type.hpp"
16
18 typedef uint32 VehicleID;
19
21 enum VehicleType {
22 VEH_BEGIN,
23
24 VEH_TRAIN = VEH_BEGIN,
25 VEH_ROAD,
26 VEH_SHIP,
27 VEH_AIRCRAFT,
28
29 VEH_COMPANY_END,
30
31 VEH_EFFECT = VEH_COMPANY_END,
32 VEH_DISASTER,
33
34 VEH_END,
35 VEH_INVALID = 0xFF,
36 };
37 DECLARE_POSTFIX_INCREMENT(VehicleType)
39 template <> struct EnumPropsT<VehicleType> : MakeEnumPropsT<VehicleType, byte, VEH_TRAIN, VEH_END, VEH_INVALID, 3> {};
41 typedef SimpleTinyEnumT<VehicleType, byte> VehicleTypeByte;
42
43 struct Vehicle;
44 struct Train;
45 struct RoadVehicle;
46 struct Ship;
47 struct Aircraft;
48 struct EffectVehicle;
49 struct DisasterVehicle;
50
52 struct BaseVehicle
53 {
54 VehicleTypeByte type;
55 };
56
57 static const VehicleID INVALID_VEHICLE = 0xFFFFF;
58
60 enum VehiclePathFinders {
61 VPF_OPF = 0,
62 VPF_NPF = 1,
63 VPF_YAPF = 2,
64 };
65
67 enum DepotCommand {
68 DEPOT_SERVICE = (1U << 28),
69 DEPOT_MASS_SEND = (1U << 29),
70 DEPOT_DONT_CANCEL = (1U << 30),
71 DEPOT_LOCATE_HANGAR = (1U << 31),
72 DEPOT_COMMAND_MASK = 0xFU << 28,
73 };
74
75 static const uint MAX_LENGTH_VEHICLE_NAME_CHARS = 32;
76
78 static const uint VEHICLE_LENGTH = 8;
79
81 enum AccelerationModel {
82 AM_ORIGINAL,
83 AM_REALISTIC,
84 };
85
87 enum EngineImageType {
88 EIT_ON_MAP = 0x00,
89 EIT_IN_DEPOT = 0x10,
90 EIT_IN_DETAILS = 0x11,
91 EIT_IN_LIST = 0x12,
92 EIT_PURCHASE = 0x20,
93 EIT_PREVIEW = 0x21,
94 };
95
96 #endif /* VEHICLE_TYPE_H */