airport.h
changeset 3697 ed277943a0fc
parent 2186 db48cf29b983
child 3701 fdbb6bcab8a2
equal deleted inserted replaced
3696:8bc4db454d1c 3697:ed277943a0fc
     8 enum {MAX_TERMINALS = 6};
     8 enum {MAX_TERMINALS = 6};
     9 enum {MAX_HELIPADS  = 2};
     9 enum {MAX_HELIPADS  = 2};
    10 
    10 
    11 // Airport types
    11 // Airport types
    12 enum {
    12 enum {
    13 	AT_SMALL = 0,
    13 	AT_SMALL         = 0,
    14 	AT_LARGE = 1,
    14 	AT_LARGE         = 1,
    15 	AT_HELIPORT = 2,
    15 	AT_HELIPORT      = 2,
    16 	AT_METROPOLITAN = 3,
    16 	AT_METROPOLITAN  = 3,
    17 	AT_INTERNATIONAL = 4,
    17 	AT_INTERNATIONAL = 4,
    18 	AT_OILRIG = 15
    18 	AT_OILRIG        = 15,
    19 };
    19 };
    20 
    20 
    21 // do not change unless you change v->subtype too. This aligns perfectly with its current setting
    21 // do not change unless you change v->subtype too. This aligns perfectly with its current setting
    22 enum {
    22 enum {
    23 	AIRCRAFT_ONLY = 0,
    23 	AIRCRAFT_ONLY    = 0,
    24 	ALL = 1,
    24 	ALL              = 1,
    25 	HELICOPTERS_ONLY = 2
    25 	HELICOPTERS_ONLY = 2,
    26 };
    26 };
    27 
    27 
    28 // Finite sTate mAchine --> FTA
    28 // Finite sTate mAchine --> FTA
    29 typedef struct AirportFTAClass {
    29 typedef struct AirportFTAClass {
    30 	byte nofelements;							// number of positions the airport consists of
    30 	byte nofelements;                     // number of positions the airport consists of
    31 	const byte *terminals;
    31 	const byte *terminals;
    32 	const byte *helipads;
    32 	const byte *helipads;
    33 	byte entry_point;							// when an airplane arrives at this airport, enter it at position entry_point
    33 	byte entry_point;                     // when an airplane arrives at this airport, enter it at position entry_point
    34 	byte acc_planes;							// accept airplanes or helicopters or both
    34 	byte acc_planes;                      // accept airplanes or helicopters or both
    35 	const TileIndexDiffC *airport_depots;	// gives the position of the depots on the airports
    35 	const TileIndexDiffC *airport_depots; // gives the position of the depots on the airports
    36 	byte nof_depots;							// number of depots this airport has
    36 	byte nof_depots;                      // number of depots this airport has
    37 	struct AirportFTA *layout;		// state machine for airport
    37 	struct AirportFTA *layout;            // state machine for airport
    38 } AirportFTAClass;
    38 } AirportFTAClass;
    39 
    39 
    40 // internal structure used in openttd - Finite sTate mAchine --> FTA
    40 // internal structure used in openttd - Finite sTate mAchine --> FTA
    41 typedef struct AirportFTA {
    41 typedef struct AirportFTA {
    42 	byte position;										// the position that an airplane is at
    42 	byte position;                    // the position that an airplane is at
    43 	byte next_position;								// next position from this position
    43 	byte next_position;               // next position from this position
    44 	uint32 block;	// 32 bit blocks (st->airport_flags), should be enough for the most complex airports
    44 	uint32 block;                     // 32 bit blocks (st->airport_flags), should be enough for the most complex airports
    45 	byte heading;	// heading (current orders), guiding an airplane to its target on an airport
    45 	byte heading;                     // heading (current orders), guiding an airplane to its target on an airport
    46 	struct AirportFTA *next_in_chain;	// possible extra movement choices from this position
    46 	struct AirportFTA *next_in_chain; // possible extra movement choices from this position
    47 } AirportFTA;
    47 } AirportFTA;
    48 
    48 
    49 void InitializeAirports(void);
    49 void InitializeAirports(void);
    50 void UnInitializeAirports(void);
    50 void UnInitializeAirports(void);
    51 const AirportFTAClass* GetAirport(const byte airport_type);
    51 const AirportFTAClass* GetAirport(const byte airport_type);