# vehicle_type.h

Go to the documentation of this file.

    00001 /* $Id: vehicle_type.h 15718 2009-03-15 00:32:18Z rubidium $ */
    00002
    00005 #ifndef VEHICLE_TYPE_H
    00006 #define VEHICLE_TYPE_H
    00007
    00008 #include "core/enum_type.hpp"
    00009
    00010 typedef uint16 VehicleID;
    00011
    00012 enum VehicleType {
    00013   VEH_TRAIN,
    00014   VEH_ROAD,
    00015   VEH_SHIP,
    00016   VEH_AIRCRAFT,
    00017   VEH_EFFECT,
    00018   VEH_DISASTER,
    00019   VEH_END,
    00020   VEH_INVALID = 0xFF,
    00021 };
    00022 DECLARE_POSTFIX_INCREMENT(VehicleType);
    00023 template <> struct EnumPropsT<VehicleType> : MakeEnumPropsT<VehicleType, byte, VEH_TRAIN, VEH_END, VEH_INVALID> {};
    00024 typedef TinyEnumT<VehicleType> VehicleTypeByte;
    00025
    00026 struct Vehicle;
    00027
    00028 struct BaseVehicle
    00029 {
    00030   VehicleTypeByte type;
    00031
    00036   inline bool IsValid() const { return this->type != VEH_INVALID; }
    00037 };
    00038
    00039 static const VehicleID INVALID_VEHICLE = 0xFFFF;
    00040
    00042 enum {
    00043   VPF_OPF  = 0,
    00044   VPF_NTP  = 0,
    00045   VPF_NPF  = 1,
    00046   VPF_YAPF = 2,
    00047 };
    00048
    00049 /* Flags to add to p2 for goto depot commands
    00050  * Note: bits 8-10 are used for VLW flags */
    00051 enum DepotCommand {
    00052   DEPOT_SERVICE       = (1 << 0),
    00053   DEPOT_MASS_SEND     = (1 << 1),
    00054   DEPOT_DONT_CANCEL   = (1 << 2),
    00055   DEPOT_LOCATE_HANGAR = (1 << 3),
    00056   DEPOT_COMMAND_MASK  = 0xF,
    00057 };
    00058
    00059 enum {
    00060   MAX_LENGTH_VEHICLE_NAME_BYTES  =  31,
    00061   MAX_LENGTH_VEHICLE_NAME_PIXELS = 150,
    00062 };
    00063
    00064 enum TrainAccelerationModel {
    00065   TAM_ORIGINAL,
    00066   TAM_REALISTIC,
    00067 };
    00068
    00069 #endif /* VEHICLE_TYPE_H */