tron@3963: /* $Id$ */ tron@3963: peter1138@3987: #ifndef AIRCRAFT_H peter1138@3987: #define AIRCRAFT_H peter1138@3987: tron@3963: #include "station_map.h" tron@3963: #include "vehicle.h" tron@3963: Darkvater@6105: typedef enum AircraftSubTypes { Darkvater@6105: AIR_HELICOPTER = 0, Darkvater@6105: AIR_AIRCRAFT = 2, Darkvater@6105: AIR_SHADOW = 4, Darkvater@6105: AIR_ROTOR = 6 Darkvater@6105: } AircraftSubType; Darkvater@6105: Darkvater@6105: Darkvater@6105: /** Check if the aircraft type is a normal flying device; eg Darkvater@6105: * not a rotor or a shadow Darkvater@6105: * @param v vehicle to check Darkvater@6105: * @return Returns true if the aircraft is a helicopter/airplane and Darkvater@6105: * false if it is a shadow or a rotor) */ Darkvater@6105: static inline bool IsNormalAircraft(const Vehicle *v) Darkvater@6105: { Darkvater@6105: assert(v->type == VEH_Aircraft); Darkvater@6105: /* To be fully correct the commented out functionality is the proper one, Darkvater@6105: * but since value can only be 0 or 2, it is sufficient to only check <= 2 Darkvater@6105: * return (v->subtype == AIR_HELICOPTER) || (v->subtype == AIR_AIRCRAFT); */ Darkvater@6105: return v->subtype <= AIR_AIRCRAFT; Darkvater@6105: } Darkvater@6105: tron@3963: tron@3963: static inline bool IsAircraftInHangar(const Vehicle* v) tron@3963: { tron@3963: assert(v->type == VEH_Aircraft); tron@3963: return v->vehstatus & VS_HIDDEN && IsHangarTile(v->tile); tron@3963: } tron@3963: tron@3963: static inline bool IsAircraftInHangarStopped(const Vehicle* v) tron@3963: { tron@3963: return IsAircraftInHangar(v) && v->vehstatus & VS_STOPPED; tron@3963: } peter1138@3987: peter1138@3987: uint16 AircraftDefaultCargoCapacity(CargoID cid, EngineID engine_type); peter1138@3987: bjarni@6031: void CcBuildAircraft(bool success, TileIndex tile, uint32 p1, uint32 p2); bjarni@4653: void CcCloneAircraft(bool success, TileIndex tile, uint32 p1, uint32 p2); belugas@4732: void HandleAircraftEnterHangar(Vehicle *v); bjarni@4653: peter1138@3987: #endif /* AIRCRAFT_H */