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, truelight@0: AT_OILRIG = 5 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 { truelight@0: byte nofelements; // number of positions the airport consists of truelight@0: byte nofterminals; // number of terminals this airport has truelight@0: byte nofterminalgroups; // terminals belong to so many groups (MAX is the nofterminals) truelight@0: byte nofhelipads; // number of helipads this airport has truelight@0: byte nofhelipadgroups; // helipads belong to so many groups (MAX is the nofhelipads) truelight@0: byte entry_point; // when an airplane arrives at this airport, enter it at position entry_point truelight@0: byte acc_planes; // accept airplanes or helicopters or both truelight@0: uint16 *airport_depots; // gives the position of the depots on the airports truelight@0: 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: truelight@0: void InitializeAirports(); truelight@0: void UnInitializeAirports(); truelight@0: const AirportFTAClass* GetAirport(const byte airport_type); truelight@0: truelight@0: #endif /* AIRPORT_H */