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