tron@2186: /* $Id$ */ tron@2186: truelight@0: #ifndef AIRPORT_H truelight@0: #define AIRPORT_H truelight@0: truelight@0: #include "airport_movement.h" truelight@0: truelight@0: enum {MAX_TERMINALS = 6}; truelight@0: enum {MAX_HELIPADS = 2}; truelight@0: truelight@0: // Airport types truelight@0: enum { truelight@0: AT_SMALL = 0, truelight@0: AT_LARGE = 1, truelight@0: AT_HELIPORT = 2, truelight@0: AT_METROPOLITAN = 3, truelight@0: AT_INTERNATIONAL = 4, celestar@950: AT_OILRIG = 15 truelight@0: }; truelight@0: truelight@0: // do not change unless you change v->subtype too. This aligns perfectly with its current setting truelight@0: enum { truelight@0: AIRCRAFT_ONLY = 0, truelight@0: ALL = 1, truelight@0: HELICOPTERS_ONLY = 2 truelight@0: }; truelight@0: truelight@0: // Finite sTate mAchine --> FTA truelight@0: typedef struct AirportFTAClass { darkvater@222: byte nofelements; // number of positions the airport consists of celestar@950: const byte *terminals; celestar@950: const byte *helipads; darkvater@222: byte entry_point; // when an airplane arrives at this airport, enter it at position entry_point darkvater@222: byte acc_planes; // accept airplanes or helicopters or both tron@909: const TileIndexDiffC *airport_depots; // gives the position of the depots on the airports tron@699: byte nof_depots; // number of depots this airport has darkvater@222: struct AirportFTA *layout; // state machine for airport truelight@0: } AirportFTAClass; truelight@0: truelight@0: // internal structure used in openttd - Finite sTate mAchine --> FTA truelight@0: typedef struct AirportFTA { truelight@0: byte position; // the position that an airplane is at truelight@0: byte next_position; // next position from this position truelight@0: uint32 block; // 32 bit blocks (st->airport_flags), should be enough for the most complex airports truelight@0: byte heading; // heading (current orders), guiding an airplane to its target on an airport truelight@0: struct AirportFTA *next_in_chain; // possible extra movement choices from this position truelight@0: } AirportFTA; truelight@0: tron@1093: void InitializeAirports(void); tron@1093: void UnInitializeAirports(void); truelight@0: const AirportFTAClass* GetAirport(const byte airport_type); truelight@0: Darkvater@1784: /** Get buildable airport bitmask. Darkvater@1784: * @return get all buildable airports at this given time, bitmasked. Darkvater@1784: * Bit 0 means the small airport is buildable, etc. Darkvater@1784: * @todo set availability of airports by year, instead of airplane Darkvater@1784: */ tron@2159: uint32 GetValidAirports(void); Darkvater@1784: truelight@0: #endif /* AIRPORT_H */