tron@2186: /* $Id$ */ tron@2186: rubidium@8108: /** @file vehicle_type.h Types related to vehicles. */ rubidium@5991: rubidium@8108: #ifndef VEHICLE_TYPE_H rubidium@8108: #define VEHICLE_TYPE_H rubidium@6000: rubidium@8108: #include "core/enum_type.hpp" rubidium@6000: rubidium@8108: typedef uint16 VehicleID; rubidium@6000: rubidium@6621: enum VehicleType { rubidium@6259: VEH_TRAIN, rubidium@6259: VEH_ROAD, rubidium@6259: VEH_SHIP, rubidium@6259: VEH_AIRCRAFT, rubidium@9008: VEH_EFFECT, rubidium@6259: VEH_DISASTER, rubidium@6621: VEH_END, rubidium@6259: VEH_INVALID = 0xFF, rubidium@6621: }; rubidium@7086: DECLARE_POSTFIX_INCREMENT(VehicleType); rubidium@6621: template <> struct EnumPropsT : MakeEnumPropsT {}; rubidium@6621: typedef TinyEnumT VehicleTypeByte; matthijs@1752: rubidium@7398: struct Vehicle; rubidium@7490: rubidium@8144: struct BaseVehicle rubidium@8144: { rubidium@8144: VehicleTypeByte type; ///< Type of vehicle rubidium@8144: rubidium@8144: /** rubidium@8144: * Is this vehicle a valid vehicle? rubidium@8144: * @return true if and only if the vehicle is valid. rubidium@8144: */ rubidium@8144: inline bool IsValid() const { return this->type != VEH_INVALID; } rubidium@8144: }; rubidium@8144: rubidium@8144: static const VehicleID INVALID_VEHICLE = 0xFFFF; rubidium@8144: smatz@8551: /** Pathfinding option states */ smatz@8551: enum { smatz@8551: VPF_OPF = 0, ///< The Original PathFinder smatz@8551: VPF_NTP = 0, ///< New Train Pathfinder, replacing OPF for trains smatz@8551: VPF_NPF = 1, ///< New PathFinder smatz@8551: VPF_YAPF = 2, ///< Yet Another PathFinder smatz@8551: }; smatz@8551: rubidium@8891: /* Flags to add to p2 for goto depot commands */ rubidium@8891: /* Note: bits 8-10 are used for VLW flags */ rubidium@8891: enum DepotCommand { rubidium@8891: DEPOT_SERVICE = (1 << 0), ///< The vehicle will leave the depot right after arrival (serivce only) rubidium@8891: DEPOT_MASS_SEND = (1 << 1), ///< Tells that it's a mass send to depot command (type in VLW flag) rubidium@8891: DEPOT_DONT_CANCEL = (1 << 2), ///< Don't cancel current goto depot command if any rubidium@8891: DEPOT_LOCATE_HANGAR = (1 << 3), ///< Find another airport if the target one lacks a hangar rubidium@8891: DEPOT_COMMAND_MASK = 0xF, rubidium@8891: }; rubidium@8891: rubidium@8108: #endif /* VEHICLE_TYPE_H */