2007-12-19 23:26:02 +00:00
|
|
|
/* $Id$ */
|
|
|
|
|
|
|
|
/** @file vehicle_type.h Types related to vehicles. */
|
|
|
|
|
|
|
|
#ifndef VEHICLE_TYPE_H
|
|
|
|
#define VEHICLE_TYPE_H
|
|
|
|
|
|
|
|
#include "core/enum_type.hpp"
|
|
|
|
|
|
|
|
typedef uint16 VehicleID;
|
|
|
|
|
2009-07-26 12:49:26 +00:00
|
|
|
/** Available vehicle types. */
|
2007-12-19 23:26:02 +00:00
|
|
|
enum VehicleType {
|
2009-07-26 12:49:26 +00:00
|
|
|
VEH_TRAIN, ///< %Train vehicle type.
|
|
|
|
VEH_ROAD, ///< Road vehicle type.
|
|
|
|
VEH_SHIP, ///< %Ship vehicle type.
|
|
|
|
VEH_AIRCRAFT, ///< %Aircraft vehicle type.
|
|
|
|
VEH_EFFECT, ///< Effect vehicle type (smoke, explosions, sparks, bubbles)
|
|
|
|
VEH_DISASTER, ///< Disaster vehicle type.
|
2007-12-19 23:26:02 +00:00
|
|
|
VEH_END,
|
2009-07-26 12:49:26 +00:00
|
|
|
VEH_INVALID = 0xFF, ///< Non-existing type of vehicle.
|
2007-12-19 23:26:02 +00:00
|
|
|
};
|
|
|
|
DECLARE_POSTFIX_INCREMENT(VehicleType);
|
2009-05-26 11:19:04 +00:00
|
|
|
/** It needs to be 8bits, because we save and load it as such */
|
|
|
|
typedef SimpleTinyEnumT<VehicleType, byte> VehicleTypeByte;
|
2007-12-19 23:26:02 +00:00
|
|
|
|
|
|
|
struct Vehicle;
|
2009-05-22 22:22:46 +00:00
|
|
|
struct Train;
|
|
|
|
struct RoadVehicle;
|
|
|
|
struct Ship;
|
|
|
|
struct Aircraft;
|
2009-06-06 16:54:22 +00:00
|
|
|
struct EffectVehicle;
|
|
|
|
struct DisasterVehicle;
|
2007-12-19 23:26:02 +00:00
|
|
|
|
2007-12-27 13:35:39 +00:00
|
|
|
struct BaseVehicle
|
|
|
|
{
|
|
|
|
VehicleTypeByte type; ///< Type of vehicle
|
|
|
|
};
|
|
|
|
|
2009-07-26 12:49:26 +00:00
|
|
|
static const VehicleID INVALID_VEHICLE = 0xFFFF; ///< Constant representing a non-existing vehicle.
|
2007-12-27 13:35:39 +00:00
|
|
|
|
2008-02-13 14:21:36 +00:00
|
|
|
/** Pathfinding option states */
|
|
|
|
enum {
|
|
|
|
VPF_OPF = 0, ///< The Original PathFinder
|
|
|
|
VPF_NTP = 0, ///< New Train Pathfinder, replacing OPF for trains
|
|
|
|
VPF_NPF = 1, ///< New PathFinder
|
|
|
|
VPF_YAPF = 2, ///< Yet Another PathFinder
|
|
|
|
};
|
|
|
|
|
2009-03-15 00:32:18 +00:00
|
|
|
/* Flags to add to p2 for goto depot commands
|
|
|
|
* Note: bits 8-10 are used for VLW flags */
|
2008-04-11 08:40:10 +00:00
|
|
|
enum DepotCommand {
|
|
|
|
DEPOT_SERVICE = (1 << 0), ///< The vehicle will leave the depot right after arrival (serivce only)
|
|
|
|
DEPOT_MASS_SEND = (1 << 1), ///< Tells that it's a mass send to depot command (type in VLW flag)
|
|
|
|
DEPOT_DONT_CANCEL = (1 << 2), ///< Don't cancel current goto depot command if any
|
|
|
|
DEPOT_LOCATE_HANGAR = (1 << 3), ///< Find another airport if the target one lacks a hangar
|
|
|
|
DEPOT_COMMAND_MASK = 0xF,
|
|
|
|
};
|
|
|
|
|
2008-08-13 06:05:01 +00:00
|
|
|
enum {
|
|
|
|
MAX_LENGTH_VEHICLE_NAME_BYTES = 31, ///< The maximum length of a vehicle name in bytes including '\0'
|
|
|
|
MAX_LENGTH_VEHICLE_NAME_PIXELS = 150, ///< The maximum length of a vehicle name in pixels
|
|
|
|
};
|
|
|
|
|
2009-01-23 20:53:43 +00:00
|
|
|
enum TrainAccelerationModel {
|
|
|
|
TAM_ORIGINAL,
|
|
|
|
TAM_REALISTIC,
|
|
|
|
};
|
|
|
|
|
2007-12-19 23:26:02 +00:00
|
|
|
#endif /* VEHICLE_TYPE_H */
|