OpenTTD
Data Structures | Macros | Variables
airport_movement.h File Reference

Heart of the airports and their finite state machines. More...

Go to the source code of this file.

Data Structures

struct  AirportFTAbuildup
 State machine input struct (from external file, etc.) Finite sTate mAchine –> FTA. More...
 

Macros

#define AMD(x, y, flags, dir)   { x, y, flags, {dir} }
 Airport movement data creation macro. More...
 
#define _airport_entries_oilrig   _airport_entries_heliport
 
#define _airport_fta_oilrig   _airport_fta_heliport
 

Variables

static const AirportMovingData _airport_moving_data_dummy []
 Dummy airport. More...
 
static const AirportMovingData _airport_moving_data_country [22]
 Country Airfield (small) 4x3. More...
 
static const AirportMovingData _airport_moving_data_commuter [37]
 Commuter Airfield (small) 5x4. More...
 
static const AirportMovingData _airport_moving_data_city []
 City Airport (large) 6x6. More...
 
static const AirportMovingData _airport_moving_data_metropolitan [28]
 Metropolitan Airport (metropolitan) - 2 runways. More...
 
static const AirportMovingData _airport_moving_data_international [51]
 International Airport (international) - 2 runways, 6 terminals, dedicated helipad. More...
 
static const AirportMovingData _airport_moving_data_intercontinental [77]
 Intercontinental Airport - 4 runways, 8 terminals, 2 dedicated helipads. More...
 
static const AirportMovingData _airport_moving_data_heliport [9]
 Heliport (heliport). More...
 
static const AirportMovingData _airport_moving_data_helidepot [18]
 HeliDepot 2x2 (heliport). More...
 
static const AirportMovingData _airport_moving_data_helistation [33]
 HeliDepot 2x2 (heliport). More...
 
static const AirportMovingData _airport_moving_data_oilrig [9]
 Oilrig. More...
 
static const byte _airport_entries_dummy [] = {0, 1, 2, 3}
 
static const AirportFTAbuildup _airport_fta_dummy []
 
static const HangarTileTable _airport_depots_country [] = { {{3, 0}, DIR_SE, 0} }
 
static const byte _airport_terminal_country [] = {1, 2}
 
static const byte _airport_entries_country [] = {16, 15, 18, 17}
 
static const AirportFTAbuildup _airport_fta_country []
 
static const HangarTileTable _airport_depots_commuter [] = { {{4, 0}, DIR_SE, 0} }
 
static const byte _airport_terminal_commuter [] = { 1, 3 }
 
static const byte _airport_entries_commuter [] = {22, 21, 24, 23}
 
static const AirportFTAbuildup _airport_fta_commuter []
 
static const HangarTileTable _airport_depots_city [] = { {{5, 0}, DIR_SE, 0} }
 
static const byte _airport_terminal_city [] = { 1, 3 }
 
static const byte _airport_entries_city [] = {26, 29, 27, 28}
 
static const AirportFTAbuildup _airport_fta_city []
 
static const HangarTileTable _airport_depots_metropolitan [] = { {{5, 0}, DIR_SE, 0} }
 
static const byte _airport_terminal_metropolitan [] = { 1, 3 }
 
static const byte _airport_entries_metropolitan [] = {20, 19, 22, 21}
 
static const AirportFTAbuildup _airport_fta_metropolitan []
 
static const HangarTileTable _airport_depots_international [] = { {{0, 3}, DIR_SE, 0}, {{6, 1}, DIR_SE, 1} }
 
static const byte _airport_terminal_international [] = { 2, 3, 3 }
 
static const byte _airport_entries_international [] = { 38, 37, 40, 39 }
 
static const AirportFTAbuildup _airport_fta_international []
 
static const HangarTileTable _airport_depots_intercontinental [] = { {{0, 5}, DIR_SE, 0}, {{8, 4}, DIR_SE, 1} }
 
static const byte _airport_terminal_intercontinental [] = { 2, 4, 4 }
 
static const byte _airport_entries_intercontinental [] = { 44, 43, 46, 45 }
 
static const AirportFTAbuildup _airport_fta_intercontinental []
 
static const byte _airport_entries_heliport [] = { 7, 7, 7, 7 }
 
static const AirportFTAbuildup _airport_fta_heliport []
 
static const HangarTileTable _airport_depots_helidepot [] = { {{1, 0}, DIR_SE, 0} }
 
static const byte _airport_entries_helidepot [] = { 4, 4, 4, 4 }
 
static const AirportFTAbuildup _airport_fta_helidepot []
 
static const HangarTileTable _airport_depots_helistation [] = { {{0, 0}, DIR_SE, 0} }
 
static const byte _airport_entries_helistation [] = { 25, 25, 25, 25 }
 
static const AirportFTAbuildup _airport_fta_helistation []
 

Detailed Description

Heart of the airports and their finite state machines.

Definition in file airport_movement.h.

Macro Definition Documentation

◆ AMD

#define AMD (   x,
  y,
  flags,
  dir 
)    { x, y, flags, {dir} }

Airport movement data creation macro.

Parameters
xX position.
yY position.
flagsMovement flags.
dirDirection.

Definition at line 37 of file airport_movement.h.

Variable Documentation

◆ _airport_fta_country

const AirportFTAbuildup _airport_fta_country[]
static
Initial value:
= {
{ 0, HANGAR, NOTHING_block, 1 },
{ 1, 255, AIRPORT_BUSY_block, 0 }, { 1, HANGAR, 0, 0 }, { 1, TERM1, TERM1_block, 2 }, { 1, TERM2, 0, 4 }, { 1, HELITAKEOFF, 0, 19 }, { 1, 0, 0, 6 },
{ 2, TERM1, TERM1_block, 1 },
{ 3, TERM2, TERM2_block, 5 },
{ 4, 255, AIRPORT_BUSY_block, 0 }, { 4, TERM2, 0, 5 }, { 4, HANGAR, 0, 1 }, { 4, TAKEOFF, 0, 6 }, { 4, HELITAKEOFF, 0, 1 },
{ 5, 255, AIRPORT_BUSY_block, 0 }, { 5, TERM2, TERM2_block, 3 }, { 5, 0, 0, 4 },
{ 6, 0, AIRPORT_BUSY_block, 7 },
{ 7, TAKEOFF, AIRPORT_BUSY_block, 8 },
{ 8, STARTTAKEOFF, NOTHING_block, 9 },
{ 9, ENDTAKEOFF, NOTHING_block, 0 },
{ 10, FLYING, NOTHING_block, 15 }, { 10, LANDING, 0, 11 }, { 10, HELILANDING, 0, 20 },
{ 11, LANDING, AIRPORT_BUSY_block, 12 },
{ 12, 0, AIRPORT_BUSY_block, 13 },
{ 13, ENDLANDING, AIRPORT_BUSY_block, 14 }, { 13, TERM2, 0, 5 }, { 13, 0, 0, 14 },
{ 14, 0, AIRPORT_BUSY_block, 1 },
{ 15, 0, NOTHING_block, 16 },
{ 16, 0, NOTHING_block, 17 },
{ 17, 0, NOTHING_block, 18 },
{ 18, 0, NOTHING_block, 10 },
{ 19, HELITAKEOFF, NOTHING_block, 0 },
{ 20, HELILANDING, AIRPORT_BUSY_block, 21 },
{ 21, HELIENDLANDING, AIRPORT_BUSY_block, 1 },
{ MAX_ELEMENTS, 0, 0, 0 }
}
Airplane wants to leave the airport.
Definition: airport.h:73
Heading for hangar.
Definition: airport.h:64
Heading for terminal 1.
Definition: airport.h:65
Airplane has reached end-point of the take-off runway.
Definition: airport.h:75
Vehicle is flying in the air.
Definition: airport.h:77
Helicopter wants to land.
Definition: airport.h:80
Heading for terminal 2.
Definition: airport.h:66
Airplane has arrived at a runway for take-off.
Definition: airport.h:74
static const uint MAX_ELEMENTS
maximum number of aircraft positions at airport
Definition: airport.h:21
Airplane wants to land.
Definition: airport.h:78
static const uint64 TERM1_block
Movement Blocks on Airports blocks (eg_airport_flags).
Definition: airport.h:90
Helicopter wants to finish landing.
Definition: airport.h:81
static const uint64 TERM2_block
Block belonging to terminal 2.
Definition: airport.h:91
Airplane wants to finish landing.
Definition: airport.h:79
Helicopter wants to leave the airport.
Definition: airport.h:76

Definition at line 423 of file airport_movement.h.

◆ _airport_fta_dummy

const AirportFTAbuildup _airport_fta_dummy[]
static
Initial value:
= {
{ 0, 0, 0, 3},
{ 1, 0, 0, 0},
{ 2, 0, 0, 1},
{ 3, 0, 0, 2},
{ MAX_ELEMENTS, 0, 0, 0 }
}
static const uint MAX_ELEMENTS
maximum number of aircraft positions at airport
Definition: airport.h:21

Definition at line 410 of file airport_movement.h.

◆ _airport_fta_helidepot

const AirportFTAbuildup _airport_fta_helidepot[]
static
Initial value:
= {
{ 0, HANGAR, NOTHING_block, 1 },
{ 1, 255, HANGAR2_AREA_block, 0 }, { 1, HANGAR, 0, 0 }, { 1, HELIPAD1, HELIPAD1_block, 14 }, { 1, HELITAKEOFF, 0, 15 }, { 1, 0, 0, 0 },
{ 2, FLYING, NOTHING_block, 3 }, { 2, HELILANDING, PRE_HELIPAD_block, 7 }, { 2, HANGAR, 0, 12 }, { 2, HELITAKEOFF, NOTHING_block, 16 },
{ 3, 0, NOTHING_block, 4 },
{ 4, 0, NOTHING_block, 5 },
{ 5, 0, NOTHING_block, 6 },
{ 6, 0, NOTHING_block, 2 },
{ 7, HELILANDING, PRE_HELIPAD_block, 8 },
{ 8, HELIENDLANDING, PRE_HELIPAD_block, 8 }, { 8, HELIPAD1, 0, 9 }, { 8, HANGAR, 0, 12 }, { 8, 0, 0, 2 },
{ 9, 0, NOTHING_block, 10 },
{ 10, 255, NOTHING_block, 10 }, { 10, HELIPAD1, HELIPAD1_block, 14 }, { 10, HANGAR, 0, 1 }, { 10, 0, 0, 14 },
{ 11, HELITAKEOFF, NOTHING_block, 0 },
{ 12, 0, HANGAR2_AREA_block, 13 },
{ 13, 0, HANGAR2_AREA_block, 1 },
{ 14, HELIPAD1, HELIPAD1_block, 14 }, { 14, HANGAR, 0, 1 }, { 14, HELITAKEOFF, 0, 17 },
{ 15, HELITAKEOFF, NOTHING_block, 0 },
{ 16, HELITAKEOFF, 0, 14 },
{ 17, 0, NOTHING_block, 11 },
{ MAX_ELEMENTS, 0, 0, 0 }
}
Heading for hangar.
Definition: airport.h:64
static const uint64 HELIPAD1_block
Block belonging to helipad 1.
Definition: airport.h:96
Vehicle is flying in the air.
Definition: airport.h:77
Helicopter wants to land.
Definition: airport.h:80
static const uint MAX_ELEMENTS
maximum number of aircraft positions at airport
Definition: airport.h:21
Heading for helipad 1.
Definition: airport.h:71
Helicopter wants to finish landing.
Definition: airport.h:81
Helicopter wants to leave the airport.
Definition: airport.h:76

Definition at line 761 of file airport_movement.h.

◆ _airport_fta_heliport

const AirportFTAbuildup _airport_fta_heliport[]
static
Initial value:
= {
{ 1, HELITAKEOFF, NOTHING_block, 0 },
{ 2, 255, AIRPORT_BUSY_block, 0 }, { 2, HELILANDING, 0, 3 }, { 2, HELITAKEOFF, 0, 1 },
{ 3, HELILANDING, AIRPORT_BUSY_block, 4 },
{ 4, HELIENDLANDING, AIRPORT_BUSY_block, 4 }, { 4, HELIPAD1, HELIPAD1_block, 0 }, { 4, HELITAKEOFF, 0, 2 },
{ 5, 0, NOTHING_block, 6 },
{ 6, 0, NOTHING_block, 7 },
{ 7, 0, NOTHING_block, 8 },
{ 8, FLYING, NOTHING_block, 5 }, { 8, HELILANDING, HELIPAD1_block, 2 },
{ MAX_ELEMENTS, 0, 0, 0 }
}
static const uint64 HELIPAD1_block
Block belonging to helipad 1.
Definition: airport.h:96
Vehicle is flying in the air.
Definition: airport.h:77
Helicopter wants to land.
Definition: airport.h:80
static const uint MAX_ELEMENTS
maximum number of aircraft positions at airport
Definition: airport.h:21
Heading for helipad 1.
Definition: airport.h:71
Helicopter wants to finish landing.
Definition: airport.h:81
Helicopter wants to leave the airport.
Definition: airport.h:76

Definition at line 742 of file airport_movement.h.

◆ _airport_moving_data_city

const AirportMovingData _airport_moving_data_city[]
static

City Airport (large) 6x6.

Definition at line 116 of file airport_movement.h.

◆ _airport_moving_data_commuter

const AirportMovingData _airport_moving_data_commuter[37]
static

Commuter Airfield (small) 5x4.

Definition at line 74 of file airport_movement.h.

◆ _airport_moving_data_country

const AirportMovingData _airport_moving_data_country[22]
static
Initial value:
= {
AMD( 53, 3, AMED_EXACTPOS, DIR_SE),
AMD( 53, 27, 0, DIR_N ),
AMD( 32, 23, AMED_EXACTPOS, DIR_NW),
AMD( 10, 23, AMED_EXACTPOS, DIR_NW),
AMD( 43, 37, 0, DIR_N ),
AMD( 24, 37, 0, DIR_N ),
AMD( 53, 37, 0, DIR_N ),
AMD( 61, 40, AMED_EXACTPOS, DIR_NE),
AMD( 3, 40, AMED_NOSPDCLAMP, DIR_N ),
AMD( 7, 40, 0, DIR_N ),
AMD( 53, 40, 0, DIR_N ),
AMD( 44, 37, AMED_HELI_RAISE, DIR_N ),
AMD( 44, 40, AMED_HELI_LOWER, DIR_N ),
}
Takeoff movement.
Definition: airport.h:51
No speed restrictions.
Definition: airport.h:50
Helicopter landing.
Definition: airport.h:57
Taxiing at the airport.
Definition: airport.h:55
Go exactly to the destination coordinates.
Definition: airport.h:54
Southeast.
Northeast.
Turn slowly (mostly used in the air).
Definition: airport.h:52
#define AMD(x, y, flags, dir)
Airport movement data creation macro.
North.
Northwest.
Landing onto landing strip.
Definition: airport.h:53
Helicopter take-off.
Definition: airport.h:56

Country Airfield (small) 4x3.

Definition at line 48 of file airport_movement.h.

◆ _airport_moving_data_dummy

const AirportMovingData _airport_moving_data_dummy[]
static
Initial value:
= {
}
No speed restrictions.
Definition: airport.h:50
Turn slowly (mostly used in the air).
Definition: airport.h:52
#define AMD(x, y, flags, dir)
Airport movement data creation macro.
North.

Dummy airport.

Definition at line 40 of file airport_movement.h.

◆ _airport_moving_data_helidepot

const AirportMovingData _airport_moving_data_helidepot[18]
static
Initial value:
= {
AMD( 24, 4, AMED_EXACTPOS, DIR_NE),
AMD( 24, 28, 0, DIR_N ),
AMD( 8, 24, AMED_HELI_RAISE, DIR_N ),
AMD( 32, 24, AMED_HELI_LOWER, DIR_NW),
AMD( 8, 24, AMED_EXACTPOS, DIR_NW),
AMD( 24, 28, AMED_HELI_RAISE, DIR_N ),
}
East.
No speed restrictions.
Definition: airport.h:50
Helicopter landing.
Definition: airport.h:57
Go exactly to the destination coordinates.
Definition: airport.h:54
Northeast.
Turn slowly (mostly used in the air).
Definition: airport.h:52
#define AMD(x, y, flags, dir)
Airport movement data creation macro.
North.
Northwest.
Helicopter take-off.
Definition: airport.h:56
Southwest.

HeliDepot 2x2 (heliport).

Definition at line 334 of file airport_movement.h.

◆ _airport_moving_data_heliport

const AirportMovingData _airport_moving_data_heliport[9]
static
Initial value:
= {
AMD( -3, 9, AMED_HELI_LOWER, DIR_N ),
AMD( 2, 9, 0, DIR_N ),
}
No speed restrictions.
Definition: airport.h:50
Helicopter landing.
Definition: airport.h:57
Go exactly to the destination coordinates.
Definition: airport.h:54
Northeast.
Turn slowly (mostly used in the air).
Definition: airport.h:52
#define AMD(x, y, flags, dir)
Airport movement data creation macro.
North.
Helicopter take-off.
Definition: airport.h:56

Heliport (heliport).

Definition at line 321 of file airport_movement.h.

◆ _airport_moving_data_helistation

const AirportMovingData _airport_moving_data_helistation[33]
static

HeliDepot 2x2 (heliport).

Definition at line 356 of file airport_movement.h.

◆ _airport_moving_data_intercontinental

const AirportMovingData _airport_moving_data_intercontinental[77]
static

Intercontinental Airport - 4 runways, 8 terminals, 2 dedicated helipads.

Definition at line 238 of file airport_movement.h.

◆ _airport_moving_data_international

const AirportMovingData _airport_moving_data_international[51]
static

International Airport (international) - 2 runways, 6 terminals, dedicated helipad.

Definition at line 182 of file airport_movement.h.

◆ _airport_moving_data_metropolitan

const AirportMovingData _airport_moving_data_metropolitan[28]
static
Initial value:
= {
AMD( 85, 3, AMED_EXACTPOS, DIR_SE),
AMD( 85, 22, 0, DIR_N ),
AMD( 26, 41, AMED_EXACTPOS, DIR_SW),
AMD( 56, 22, AMED_EXACTPOS, DIR_SE),
AMD( 38, 8, AMED_EXACTPOS, DIR_SW),
AMD( 65, 6, 0, DIR_N ),
AMD( 80, 27, 0, DIR_N ),
AMD( 49, 58, 0, DIR_N ),
AMD( 72, 58, 0, DIR_N ),
AMD( 72, 69, 0, DIR_N ),
AMD( 89, 69, AMED_EXACTPOS, DIR_NE),
AMD( 3, 69, AMED_NOSPDCLAMP, DIR_N ),
AMD( 21, 85, 0, DIR_N ),
AMD( 21, 69, 0, DIR_N ),
AMD( 21, 58, AMED_EXACTPOS, DIR_SW),
AMD( 44, 58, 0, DIR_N ),
AMD( 44, 63, AMED_HELI_RAISE, DIR_N ),
AMD( 15, 54, AMED_HELI_LOWER, DIR_N ),
AMD( 21, 58, AMED_EXACTPOS, DIR_SW),
}
Takeoff movement.
Definition: airport.h:51
No speed restrictions.
Definition: airport.h:50
Helicopter landing.
Definition: airport.h:57
Taxiing at the airport.
Definition: airport.h:55
Go exactly to the destination coordinates.
Definition: airport.h:54
Southeast.
Northeast.
Turn slowly (mostly used in the air).
Definition: airport.h:52
#define AMD(x, y, flags, dir)
Airport movement data creation macro.
North.
Landing onto landing strip.
Definition: airport.h:53
Helicopter take-off.
Definition: airport.h:56
Southwest.

Metropolitan Airport (metropolitan) - 2 runways.

Definition at line 150 of file airport_movement.h.

◆ _airport_moving_data_oilrig

const AirportMovingData _airport_moving_data_oilrig[9]
static
Initial value:
= {
AMD( 31, 9, AMED_EXACTPOS, DIR_NE),
AMD( 28, 9, AMED_HELI_RAISE, DIR_N ),
AMD( 23, 9, AMED_HELI_LOWER, DIR_N ),
AMD( 28, 9, 0, DIR_N ),
}
No speed restrictions.
Definition: airport.h:50
Helicopter landing.
Definition: airport.h:57
Go exactly to the destination coordinates.
Definition: airport.h:54
Northeast.
Turn slowly (mostly used in the air).
Definition: airport.h:52
#define AMD(x, y, flags, dir)
Airport movement data creation macro.
North.
Helicopter take-off.
Definition: airport.h:56

Oilrig.

Definition at line 393 of file airport_movement.h.