110 OUT_WAY_block2 = 1 << 31, |
110 OUT_WAY_block2 = 1 << 31, |
111 // end of new blocks |
111 // end of new blocks |
112 |
112 |
113 NOTHING_block = 1 << 30; |
113 NOTHING_block = 1 << 30; |
114 |
114 |
115 typedef struct AirportMovingData { |
115 struct AirportMovingData { |
116 int16 x; |
116 int16 x; |
117 int16 y; |
117 int16 y; |
118 uint16 flag; |
118 uint16 flag; |
119 DirectionByte direction; |
119 DirectionByte direction; |
120 } AirportMovingData; |
120 }; |
121 |
121 |
122 struct AirportFTAbuildup; |
122 struct AirportFTAbuildup; |
123 |
123 |
124 // Finite sTate mAchine --> FTA |
124 // Finite sTate mAchine --> FTA |
125 typedef struct AirportFTAClass { |
125 struct AirportFTAClass { |
126 public: |
126 public: |
127 enum Flags { |
127 enum Flags { |
128 AIRPLANES = 0x1, |
128 AIRPLANES = 0x1, |
129 HELICOPTERS = 0x2, |
129 HELICOPTERS = 0x2, |
130 ALL = AIRPLANES | HELICOPTERS, |
130 ALL = AIRPLANES | HELICOPTERS, |
165 const byte *entry_points; ///< when an airplane arrives at this airport, enter it at position entry_point, index depends on direction |
165 const byte *entry_points; ///< when an airplane arrives at this airport, enter it at position entry_point, index depends on direction |
166 byte size_x; |
166 byte size_x; |
167 byte size_y; |
167 byte size_y; |
168 byte delta_z; // Z adjustment for helicopter pads |
168 byte delta_z; // Z adjustment for helicopter pads |
169 byte catchment; |
169 byte catchment; |
170 } AirportFTAClass; |
170 }; |
171 |
171 |
172 DECLARE_ENUM_AS_BIT_SET(AirportFTAClass::Flags) |
172 DECLARE_ENUM_AS_BIT_SET(AirportFTAClass::Flags) |
173 |
173 |
174 |
174 |
175 // internal structure used in openttd - Finite sTate mAchine --> FTA |
175 // internal structure used in openttd - Finite sTate mAchine --> FTA |
176 typedef struct AirportFTA { |
176 struct AirportFTA { |
177 struct AirportFTA *next; // possible extra movement choices from this position |
177 AirportFTA *next; // possible extra movement choices from this position |
178 uint64 block; // 64 bit blocks (st->airport_flags), should be enough for the most complex airports |
178 uint64 block; // 64 bit blocks (st->airport_flags), should be enough for the most complex airports |
179 byte position; // the position that an airplane is at |
179 byte position; // the position that an airplane is at |
180 byte next_position; // next position from this position |
180 byte next_position; // next position from this position |
181 byte heading; // heading (current orders), guiding an airplane to its target on an airport |
181 byte heading; // heading (current orders), guiding an airplane to its target on an airport |
182 } AirportFTA; |
182 }; |
183 |
183 |
184 void InitializeAirports(); |
184 void InitializeAirports(); |
185 void UnInitializeAirports(); |
185 void UnInitializeAirports(); |
186 const AirportFTAClass *GetAirport(const byte airport_type); |
186 const AirportFTAClass *GetAirport(const byte airport_type); |
187 |
187 |