diff --git a/airport.h b/airport.h --- a/airport.h +++ b/airport.h @@ -48,4 +48,20 @@ void InitializeAirports(void); void UnInitializeAirports(void); const AirportFTAClass* GetAirport(const byte airport_type); +/** Get buildable airport bitmask. + * @return get all buildable airports at this given time, bitmasked. + * Bit 0 means the small airport is buildable, etc. + * @todo set availability of airports by year, instead of airplane + */ +static inline uint32 GetValidAirports(void) +{ + uint32 bytemask = _avail_aircraft; /// sets the first 3 bytes, 0 - 2, @see AdjustAvailAircraft() + + // 1980-1-1 is --> 21915 + // 1990-1-1 is --> 25568 + if (_date >= 21915) {SETBIT(bytemask, 3);} // metropilitan airport 1980 + if (_date >= 25568) {SETBIT(bytemask, 4);} // international airport 1990 + return bytemask; +} + #endif /* AIRPORT_H */