# vehicle_type.h

Go to the documentation of this file.

    00001 /* $Id: vehicle_type.h 18963 2010-01-30 16:27:35Z terkhen $ */
    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);
    00032 typedef SimpleTinyEnumT<VehicleType, byte> VehicleTypeByte;
    00033
    00034 struct Vehicle;
    00035 struct Train;
    00036 struct RoadVehicle;
    00037 struct Ship;
    00038 struct Aircraft;
    00039 struct EffectVehicle;
    00040 struct DisasterVehicle;
    00041
    00042 struct BaseVehicle
    00043 {
    00044   VehicleTypeByte type;
    00045 };
    00046
    00047 static const VehicleID INVALID_VEHICLE = 0xFFFF;
    00048
    00050 enum {
    00051   VPF_OPF  = 0,
    00052   VPF_NPF  = 1,
    00053   VPF_YAPF = 2,
    00054 };
    00055
    00056 /* Flags to add to p2 for goto depot commands
    00057  * Note: bits 8-10 are used for VLW flags */
    00058 enum DepotCommand {
    00059   DEPOT_SERVICE       = (1 << 0),
    00060   DEPOT_MASS_SEND     = (1 << 1),
    00061   DEPOT_DONT_CANCEL   = (1 << 2),
    00062   DEPOT_LOCATE_HANGAR = (1 << 3),
    00063   DEPOT_COMMAND_MASK  = 0xF,
    00064 };
    00065
    00066 enum {
    00067   MAX_LENGTH_VEHICLE_NAME_BYTES  =  31,
    00068   MAX_LENGTH_VEHICLE_NAME_PIXELS = 150,
    00069 };
    00070
    00072 enum AccelerationModel {
    00073   AM_ORIGINAL,
    00074   AM_REALISTIC,
    00075 };
    00076
    00077 #endif /* VEHICLE_TYPE_H */