equal
deleted
inserted
replaced
3 #ifndef AIRCRAFT_H |
3 #ifndef AIRCRAFT_H |
4 #define AIRCRAFT_H |
4 #define AIRCRAFT_H |
5 |
5 |
6 #include "station_map.h" |
6 #include "station_map.h" |
7 #include "vehicle.h" |
7 #include "vehicle.h" |
|
8 |
|
9 typedef enum AircraftSubTypes { |
|
10 AIR_HELICOPTER = 0, |
|
11 AIR_AIRCRAFT = 2, |
|
12 AIR_SHADOW = 4, |
|
13 AIR_ROTOR = 6 |
|
14 } AircraftSubType; |
|
15 |
|
16 |
|
17 /** Check if the aircraft type is a normal flying device; eg |
|
18 * not a rotor or a shadow |
|
19 * @param v vehicle to check |
|
20 * @return Returns true if the aircraft is a helicopter/airplane and |
|
21 * false if it is a shadow or a rotor) */ |
|
22 static inline bool IsNormalAircraft(const Vehicle *v) |
|
23 { |
|
24 assert(v->type == VEH_Aircraft); |
|
25 /* To be fully correct the commented out functionality is the proper one, |
|
26 * but since value can only be 0 or 2, it is sufficient to only check <= 2 |
|
27 * return (v->subtype == AIR_HELICOPTER) || (v->subtype == AIR_AIRCRAFT); */ |
|
28 return v->subtype <= AIR_AIRCRAFT; |
|
29 } |
8 |
30 |
9 |
31 |
10 static inline bool IsAircraftInHangar(const Vehicle* v) |
32 static inline bool IsAircraftInHangar(const Vehicle* v) |
11 { |
33 { |
12 assert(v->type == VEH_Aircraft); |
34 assert(v->type == VEH_Aircraft); |