(svn r16614) -Codechange: Make the airport min/max available year a property of the Airport class.

-Change: rename station.always_small_airport to station.never_expire_airports to make it more future-proof
This commit is contained in:
yexo
2009-06-21 13:26:30 +00:00
parent 548a605263
commit c7bd6c8d34
54 changed files with 58 additions and 104 deletions

View File

@@ -8,6 +8,7 @@
#include "direction_type.h"
#include "map_type.h"
#include "tile_type.h"
#include "date_type.h"
/** Current limits for airports */
enum {
@@ -151,7 +152,9 @@ struct AirportFTAClass {
uint size_y,
uint8 noise_level,
byte delta_z,
byte catchment
byte catchment,
Year first_available,
Year last_available
);
~AirportFTAClass();
@@ -162,6 +165,9 @@ struct AirportFTAClass {
return &moving_data[position];
}
/** Is this airport available at this date? */
bool IsAvailable() const;
const AirportMovingData *moving_data;
struct AirportFTA *layout; ///< state machine for airport
const byte *terminals;
@@ -176,6 +182,8 @@ struct AirportFTAClass {
uint8 noise_level; ///< noise that this airport generates
byte delta_z; ///< Z adjustment for helicopter pads
byte catchment;
Year first_available; ///< the year this airport becomes available
Year last_available; ///< the year this airport expires
};
DECLARE_ENUM_AS_BIT_SET(AirportFTAClass::Flags)
@@ -194,13 +202,6 @@ void InitializeAirports();
void UnInitializeAirports();
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
*/
uint32 GetValidAirports();
extern const byte * const _airport_sections[];
#endif /* AIRPORT_H */