# 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
    00018 typedef uint32 VehicleID;
    00019
    00021 enum VehicleType {
    00022   VEH_BEGIN,
    00023
    00024   VEH_TRAIN = VEH_BEGIN,
    00025   VEH_ROAD,
    00026   VEH_SHIP,
    00027   VEH_AIRCRAFT,
    00028
    00029   VEH_COMPANY_END,
    00030
    00031   VEH_EFFECT = VEH_COMPANY_END,
    00032   VEH_DISASTER,
    00033
    00034   VEH_END,
    00035   VEH_INVALID = 0xFF,
    00036 };
    00037 DECLARE_POSTFIX_INCREMENT(VehicleType)
    00039 template <> struct EnumPropsT<VehicleType> : MakeEnumPropsT<VehicleType, byte, VEH_TRAIN, VEH_END, VEH_INVALID, 3> {};
    00041 typedef SimpleTinyEnumT<VehicleType, byte> VehicleTypeByte;
    00042
    00043 struct Vehicle;
    00044 struct Train;
    00045 struct RoadVehicle;
    00046 struct Ship;
    00047 struct Aircraft;
    00048 struct EffectVehicle;
    00049 struct DisasterVehicle;
    00050
    00052 struct BaseVehicle
    00053 {
    00054   VehicleTypeByte type;
    00055 };
    00056
    00057 static const VehicleID INVALID_VEHICLE = 0xFFFFF;
    00058
    00060 enum VehiclePathFinders {
    00061   VPF_OPF  = 0,
    00062   VPF_NPF  = 1,
    00063   VPF_YAPF = 2,
    00064 };
    00065
    00067 enum DepotCommand {
    00068   DEPOT_SERVICE       = (1U << 28),
    00069   DEPOT_MASS_SEND     = (1U << 29),
    00070   DEPOT_DONT_CANCEL   = (1U << 30),
    00071   DEPOT_LOCATE_HANGAR = (1U << 31),
    00072   DEPOT_COMMAND_MASK  = 0xFU << 28,
    00073 };
    00074
    00075 static const uint MAX_LENGTH_VEHICLE_NAME_CHARS = 32;
    00076
    00078 static const uint VEHICLE_LENGTH = 8;
    00079
    00081 enum AccelerationModel {
    00082   AM_ORIGINAL,
    00083   AM_REALISTIC,
    00084 };
    00085
    00087 enum EngineImageType {
    00088   EIT_ON_MAP     = 0x00,
    00089   EIT_IN_DEPOT   = 0x10,
    00090   EIT_IN_DETAILS = 0x11,
    00091   EIT_IN_LIST    = 0x12,
    00092   EIT_PURCHASE   = 0x20,
    00093   EIT_PREVIEW    = 0x21,
    00094 };
    00095
    00096 #endif /* VEHICLE_TYPE_H */