OpenTTD Source  20241108-master-g80f628063a
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 [38]
 Commuter Airfield (small) 5x4.
 
static const AirportMovingData _airport_moving_data_city []
 City Airport (large) 6x6.
 
static const AirportMovingData _airport_moving_data_metropolitan [28]
 Metropolitan Airport (metropolitan) - 2 runways. More...
 
static const AirportMovingData _airport_moving_data_international [53]
 International Airport (international) - 2 runways, 6 terminals, dedicated helipad.
 
static const AirportMovingData _airport_moving_data_intercontinental [77]
 Intercontinental Airport - 4 runways, 8 terminals, 2 dedicated helipads.
 
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).
 
static const AirportMovingData _airport_moving_data_oilrig [9]
 Oilrig. More...
 
static const uint8_t _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 uint8_t _airport_terminal_country [] = {1, 2}
 
static const uint8_t _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 uint8_t _airport_terminal_commuter [] = { 1, 3 }
 
static const uint8_t _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 uint8_t _airport_terminal_city [] = { 1, 3 }
 
static const uint8_t _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 uint8_t _airport_terminal_metropolitan [] = { 1, 3 }
 
static const uint8_t _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 uint8_t _airport_terminal_international [] = { 2, 3, 3 }
 
static const uint8_t _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 uint8_t _airport_terminal_intercontinental [] = { 2, 4, 4 }
 
static const uint8_t _airport_entries_intercontinental [] = { 44, 43, 46, 45 }
 
static const AirportFTAbuildup _airport_fta_intercontinental []
 
static const uint8_t _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 uint8_t _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 uint8_t _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 35 of file airport_movement.h.

Variable Documentation

◆ _airport_fta_country

const AirportFTAbuildup _airport_fta_country[]
static
Initial value:
= {
{ 0, HANGAR, NOTHING_block, 1 },
{ 1, TERMGROUP, AIRPORT_BUSY_block, 0 }, { 1, HANGAR, 0, 0 }, { 1, TERM1, TERM1_block, 2 }, { 1, TERM2, 0, 4 }, { 1, HELITAKEOFF, 0, 19 }, { 1, TO_ALL, 0, 6 },
{ 2, TERM1, TERM1_block, 1 },
{ 3, TERM2, TERM2_block, 5 },
{ 4, TERMGROUP, AIRPORT_BUSY_block, 0 }, { 4, TERM2, 0, 5 }, { 4, HANGAR, 0, 1 }, { 4, TAKEOFF, 0, 6 }, { 4, HELITAKEOFF, 0, 1 },
{ 5, TERMGROUP, AIRPORT_BUSY_block, 0 }, { 5, TERM2, TERM2_block, 3 }, { 5, TO_ALL, 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, TO_ALL, AIRPORT_BUSY_block, 13 },
{ 13, ENDLANDING, AIRPORT_BUSY_block, 14 }, { 13, TERM2, 0, 5 }, { 13, TO_ALL, 0, 14 },
{ 14, TO_ALL, AIRPORT_BUSY_block, 1 },
{ 15, TO_ALL, NOTHING_block, 16 },
{ 16, TO_ALL, NOTHING_block, 17 },
{ 17, TO_ALL, NOTHING_block, 18 },
{ 18, TO_ALL, NOTHING_block, 10 },
{ 19, HELITAKEOFF, NOTHING_block, 0 },
{ 20, HELILANDING, AIRPORT_BUSY_block, 21 },
{ 21, HELIENDLANDING, AIRPORT_BUSY_block, 1 },
{ MAX_ELEMENTS, TO_ALL, 0, 0 }
}
static const uint MAX_ELEMENTS
maximum number of aircraft positions at airport
Definition: airport.h:19
static const uint64_t TERM2_block
Block belonging to terminal 2.
Definition: airport.h:90
static const uint64_t TERM1_block
Movement Blocks on Airports blocks (eg_airport_flags).
Definition: airport.h:89
@ HELITAKEOFF
Helicopter wants to leave the airport.
Definition: airport.h:74
@ STARTTAKEOFF
Airplane has arrived at a runway for take-off.
Definition: airport.h:72
@ ENDTAKEOFF
Airplane has reached end-point of the take-off runway.
Definition: airport.h:73
@ TERM2
Heading for terminal 2.
Definition: airport.h:64
@ HANGAR
Heading for hangar.
Definition: airport.h:62
@ FLYING
Vehicle is flying in the air.
Definition: airport.h:75
@ TAKEOFF
Airplane wants to leave the airport.
Definition: airport.h:71
@ HELILANDING
Helicopter wants to land.
Definition: airport.h:78
@ TO_ALL
Go in this direction for every target.
Definition: airport.h:61
@ ENDLANDING
Airplane wants to finish landing.
Definition: airport.h:77
@ HELIENDLANDING
Helicopter wants to finish landing.
Definition: airport.h:79
@ TERM1
Heading for terminal 1.
Definition: airport.h:63
@ LANDING
Airplane wants to land.
Definition: airport.h:76
@ TERMGROUP
Aircraft is looking for a free terminal in a terminalgroup.
Definition: airport.h:84

Definition at line 424 of file airport_movement.h.

◆ _airport_fta_dummy

const AirportFTAbuildup _airport_fta_dummy[]
static
Initial value:
= {
{ 0, TO_ALL, 0, 3},
{ 1, TO_ALL, 0, 0},
{ 2, TO_ALL, 0, 1},
{ 3, TO_ALL, 0, 2},
{ MAX_ELEMENTS, TO_ALL, 0, 0 }
}

Definition at line 411 of file airport_movement.h.

◆ _airport_fta_helidepot

const AirportFTAbuildup _airport_fta_helidepot[]
static
Initial value:
= {
{ 0, HANGAR, NOTHING_block, 1 },
{ 1, TERMGROUP, HANGAR2_AREA_block, 0 }, { 1, HANGAR, 0, 0 }, { 1, HELIPAD1, HELIPAD1_block, 14 }, { 1, HELITAKEOFF, 0, 15 }, { 1, TO_ALL, 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, TO_ALL, 0, 2 },
{ 9, 0, NOTHING_block, 10 },
{ 10, TERMGROUP, NOTHING_block, 10 }, { 10, HELIPAD1, HELIPAD1_block, 14 }, { 10, HANGAR, 0, 1 }, { 10, TO_ALL, 0, 14 },
{ 11, HELITAKEOFF, NOTHING_block, 0 },
{ 12, TO_ALL, HANGAR2_AREA_block, 13 },
{ 13, TO_ALL, 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, TO_ALL, NOTHING_block, 11 },
{ MAX_ELEMENTS, TO_ALL, 0, 0 }
}
static const uint64_t HELIPAD1_block
Block belonging to helipad 1.
Definition: airport.h:95
@ HELIPAD1
Heading for helipad 1.
Definition: airport.h:69

Definition at line 765 of file airport_movement.h.

◆ _airport_fta_heliport

const AirportFTAbuildup _airport_fta_heliport[]
static
Initial value:
= {
{ 1, HELITAKEOFF, NOTHING_block, 0 },
{ 2, TERMGROUP, 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, TO_ALL, NOTHING_block, 6 },
{ 6, TO_ALL, NOTHING_block, 7 },
{ 7, TO_ALL, NOTHING_block, 8 },
{ 8, FLYING, NOTHING_block, 5 }, { 8, HELILANDING, HELIPAD1_block, 2 },
{ MAX_ELEMENTS, TO_ALL, 0, 0 }
}

Definition at line 746 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 ),
}
@ AMED_BRAKE
Taxiing at the airport.
Definition: airport.h:53
@ AMED_SLOWTURN
Turn slowly (mostly used in the air).
Definition: airport.h:50
@ AMED_HELI_LOWER
Helicopter landing.
Definition: airport.h:55
@ AMED_LAND
Landing onto landing strip.
Definition: airport.h:51
@ AMED_NOSPDCLAMP
No speed restrictions.
Definition: airport.h:48
@ AMED_TAKEOFF
Takeoff movement.
Definition: airport.h:49
@ AMED_EXACTPOS
Go exactly to the destination coordinates.
Definition: airport.h:52
@ AMED_HELI_RAISE
Helicopter take-off.
Definition: airport.h:54
#define AMD(x, y, flags, dir)
Airport movement data creation macro.
@ DIR_NW
Northwest.
@ DIR_N
North.
@ DIR_SE
Southeast.
@ DIR_NE
Northeast.

Country Airfield (small) 4x3.

Definition at line 46 of file airport_movement.h.

◆ _airport_moving_data_dummy

const AirportMovingData _airport_moving_data_dummy[]
static
Initial value:

Dummy airport.

Definition at line 38 of file airport_movement.h.

◆ _airport_moving_data_helidepot

const AirportMovingData _airport_moving_data_helidepot[18]
static
Initial value:

HeliDepot 2x2 (heliport).

Definition at line 335 of file airport_movement.h.

◆ _airport_moving_data_heliport

const AirportMovingData _airport_moving_data_heliport[9]
static
Initial value:

Heliport (heliport).

Definition at line 322 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),
}

Metropolitan Airport (metropolitan) - 2 runways.

Definition at line 149 of file airport_movement.h.

◆ _airport_moving_data_oilrig

const AirportMovingData _airport_moving_data_oilrig[9]
static
Initial value:

Oilrig.

Definition at line 394 of file airport_movement.h.