# vehicle_type.h

Go to the documentation of this file.

    00001 /* $Id: vehicle_type.h 19665 2010-04-17 22:27:49Z rubidium $ */
    00002
    00003 /*
    00004  * This file is part of OpenTTD.
    00005  * 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.
    00006  * 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.
    00007  * 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/>.
    00008  */
    00009
    00012 #ifndef VEHICLE_TYPE_H
    00013 #define VEHICLE_TYPE_H
    00014
    00015 #include "core/enum_type.hpp"
    00016
    00017 typedef uint16 VehicleID;
    00018
    00020 enum VehicleType {
    00021   VEH_TRAIN,
    00022   VEH_ROAD,
    00023   VEH_SHIP,
    00024   VEH_AIRCRAFT,
    00025   VEH_EFFECT,
    00026   VEH_DISASTER,
    00027   VEH_END,
    00028   VEH_INVALID = 0xFF,
    00029 };
    00030 DECLARE_POSTFIX_INCREMENT(VehicleType);
    00031 template <> struct EnumPropsT<VehicleType> : MakeEnumPropsT<VehicleType, byte, VEH_TRAIN, VEH_END, VEH_INVALID, 3> {};
    00033 typedef SimpleTinyEnumT<VehicleType, byte> VehicleTypeByte;
    00034
    00035 struct Vehicle;
    00036 struct Train;
    00037 struct RoadVehicle;
    00038 struct Ship;
    00039 struct Aircraft;
    00040 struct EffectVehicle;
    00041 struct DisasterVehicle;
    00042
    00043 struct BaseVehicle
    00044 {
    00045   VehicleTypeByte type;
    00046 };
    00047
    00048 static const VehicleID INVALID_VEHICLE = 0xFFFF;
    00049
    00051 enum {
    00052   VPF_OPF  = 0,
    00053   VPF_NPF  = 1,
    00054   VPF_YAPF = 2,
    00055 };
    00056
    00057 /* Flags to add to p2 for goto depot commands
    00058  * Note: bits 8-10 are used for VLW flags */
    00059 enum DepotCommand {
    00060   DEPOT_SERVICE       = (1 << 0),
    00061   DEPOT_MASS_SEND     = (1 << 1),
    00062   DEPOT_DONT_CANCEL   = (1 << 2),
    00063   DEPOT_LOCATE_HANGAR = (1 << 3),
    00064   DEPOT_COMMAND_MASK  = 0xF,
    00065 };
    00066
    00067 enum {
    00068   MAX_LENGTH_VEHICLE_NAME_BYTES  =  31,
    00069   MAX_LENGTH_VEHICLE_NAME_PIXELS = 150,
    00070 };
    00071
    00073 enum AccelerationModel {
    00074   AM_ORIGINAL,
    00075   AM_REALISTIC,
    00076 };
    00077
    00078 #endif /* VEHICLE_TYPE_H */