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_TRAIN,          
00023   VEH_ROAD,           
00024   VEH_SHIP,           
00025   VEH_AIRCRAFT,       
00026   VEH_EFFECT,         
00027   VEH_DISASTER,       
00028   VEH_END,
00029   VEH_INVALID = 0xFF, 
00030 };
00031 DECLARE_POSTFIX_INCREMENT(VehicleType)
00033 template <> struct EnumPropsT<VehicleType> : MakeEnumPropsT<VehicleType, byte, VEH_TRAIN, VEH_END, VEH_INVALID, 3> {};
00035 typedef SimpleTinyEnumT<VehicleType, byte> VehicleTypeByte;
00036 
00037 struct Vehicle;
00038 struct Train;
00039 struct RoadVehicle;
00040 struct Ship;
00041 struct Aircraft;
00042 struct EffectVehicle;
00043 struct DisasterVehicle;
00044 
00046 struct BaseVehicle
00047 {
00048   VehicleTypeByte type;    
00049 };
00050 
00051 static const VehicleID INVALID_VEHICLE = 0xFFFFF; 
00052 
00054 enum VehiclePathFinders {
00055   VPF_OPF  = 0, 
00056   VPF_NPF  = 1, 
00057   VPF_YAPF = 2, 
00058 };
00059 
00061 enum DepotCommand {
00062   DEPOT_SERVICE       = (1U << 28), 
00063   DEPOT_MASS_SEND     = (1U << 29), 
00064   DEPOT_DONT_CANCEL   = (1U << 30), 
00065   DEPOT_LOCATE_HANGAR = (1U << 31), 
00066   DEPOT_COMMAND_MASK  = 0xFU << 28,
00067 };
00068 
00069 static const uint MAX_LENGTH_VEHICLE_NAME_CHARS = 32; 
00070 
00072 static const uint VEHICLE_LENGTH = 8;
00073 
00075 enum AccelerationModel {
00076   AM_ORIGINAL,
00077   AM_REALISTIC,
00078 };
00079 
00080 #endif /* VEHICLE_TYPE_H */

Generated on Sun Jun 5 04:20:06 2011 for OpenTTD by  doxygen 1.6.1