# vehicle_type.h

Go to the documentation of this file.

    00001 /* $Id$ */
    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 uint32 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
    00044 struct BaseVehicle
    00045 {
    00046   VehicleTypeByte type;
    00047 };
    00048
    00049 static const VehicleID INVALID_VEHICLE = 0xFFFFF;
    00050
    00052 enum VehiclePathFinders {
    00053   VPF_OPF  = 0,
    00054   VPF_NPF  = 1,
    00055   VPF_YAPF = 2,
    00056 };
    00057
    00059 enum DepotCommand {
    00060   DEPOT_SERVICE       = (1U << 28),
    00061   DEPOT_MASS_SEND     = (1U << 29),
    00062   DEPOT_DONT_CANCEL   = (1U << 30),
    00063   DEPOT_LOCATE_HANGAR = (1U << 31),
    00064   DEPOT_COMMAND_MASK  = 0xFU << 28,
    00065 };
    00066
    00067 static const uint MAX_LENGTH_VEHICLE_NAME_CHARS  =  32;
    00068 static const uint MAX_LENGTH_VEHICLE_NAME_PIXELS = 150;
    00069
    00071 static const uint VEHICLE_LENGTH = 8;
    00072
    00074 enum AccelerationModel {
    00075   AM_ORIGINAL,
    00076   AM_REALISTIC,
    00077 };
    00078
    00079 #endif /* VEHICLE_TYPE_H */