1
/* $Id: vehicle_type.h 22224 2011-03-07 19:18:38Z rubidium $ */
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/>.
10
/** @file vehicle_type.h Types related to vehicles. */
12
#ifndef VEHICLE_TYPE_H
13
#define VEHICLE_TYPE_H
15
#include "core/enum_type.hpp"
17
typedef uint32 VehicleID;
19
/** Available vehicle types. */
21
VEH_TRAIN, ///< %Train vehicle type.
22
VEH_ROAD, ///< Road vehicle type.
23
VEH_SHIP, ///< %Ship vehicle type.
24
VEH_AIRCRAFT, ///< %Aircraft vehicle type.
25
VEH_EFFECT, ///< Effect vehicle type (smoke, explosions, sparks, bubbles)
26
VEH_DISASTER, ///< Disaster vehicle type.
28
VEH_INVALID = 0xFF, ///< Non-existing type of vehicle.
30
DECLARE_POSTFIX_INCREMENT(VehicleType)
31
template <> struct EnumPropsT<VehicleType> : MakeEnumPropsT<VehicleType, byte, VEH_TRAIN, VEH_END, VEH_INVALID, 3> {};
32
/** It needs to be 8bits, because we save and load it as such */
33
typedef SimpleTinyEnumT<VehicleType, byte> VehicleTypeByte;
41
struct DisasterVehicle;
43
/** Base vehicle class. */
46
VehicleTypeByte type; ///< Type of vehicle
49
static const VehicleID INVALID_VEHICLE = 0xFFFFF; ///< Constant representing a non-existing vehicle.
51
/** Pathfinding option states */
52
enum VehiclePathFinders {
53
VPF_OPF = 0, ///< The Original PathFinder (only for ships)
54
VPF_NPF = 1, ///< New PathFinder
55
VPF_YAPF = 2, ///< Yet Another PathFinder
58
/** Flags to add to p1 for goto depot commands. */
60
DEPOT_SERVICE = (1U << 28), ///< The vehicle will leave the depot right after arrival (serivce only)
61
DEPOT_MASS_SEND = (1U << 29), ///< Tells that it's a mass send to depot command (type in VLW flag)
62
DEPOT_DONT_CANCEL = (1U << 30), ///< Don't cancel current goto depot command if any
63
DEPOT_LOCATE_HANGAR = (1U << 31), ///< Find another airport if the target one lacks a hangar
64
DEPOT_COMMAND_MASK = 0xFU << 28,
67
static const uint MAX_LENGTH_VEHICLE_NAME_CHARS = 32; ///< The maximum length of a vehicle name in characters including '\0'
68
static const uint MAX_LENGTH_VEHICLE_NAME_PIXELS = 150; ///< The maximum length of a vehicle name in pixels
70
/** The length of a vehicle in tile units. */
71
static const uint VEHICLE_LENGTH = 8;
73
/** Vehicle acceleration models. */
74
enum AccelerationModel {
79
#endif /* VEHICLE_TYPE_H */