OpenTTD Source 20250312-master-gcdcc6b491d
airport_movement.h File Reference

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

#include "../airport.h"
#include "../newgrf_airport.h"

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 _airport_entries_oilrig   _airport_entries_heliport
 
#define _airport_fta_oilrig   _airport_fta_heliport
 

Variables

static const AirportMovingData _airport_moving_data_dummy []
 Airport movement data creation macro.
 
static const AirportMovingData _airport_moving_data_country [22]
 Country Airfield (small) 4x3.
 
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.
 
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).
 
static const AirportMovingData _airport_moving_data_helidepot [18]
 HeliDepot 2x2 (heliport).
 
static const AirportMovingData _airport_moving_data_helistation [33]
 HeliDepot 2x2 (heliport).
 
static const AirportMovingData _airport_moving_data_oilrig [9]
 Oilrig.
 
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

◆ _airport_entries_oilrig

#define _airport_entries_oilrig   _airport_entries_heliport

Definition at line 759 of file airport_movement.h.

◆ _airport_fta_oilrig

#define _airport_fta_oilrig   _airport_fta_heliport

Definition at line 760 of file airport_movement.h.

Variable Documentation

◆ _airport_depots_city

const HangarTileTable _airport_depots_city[] = { {{5, 0}, DIR_SE, 0} }
static

Definition at line 504 of file airport_movement.h.

◆ _airport_depots_commuter

const HangarTileTable _airport_depots_commuter[] = { {{4, 0}, DIR_SE, 0} }
static

Definition at line 453 of file airport_movement.h.

◆ _airport_depots_country

const HangarTileTable _airport_depots_country[] = { {{3, 0}, DIR_SE, 0} }
static

Definition at line 421 of file airport_movement.h.

◆ _airport_depots_helidepot

const HangarTileTable _airport_depots_helidepot[] = { {{1, 0}, DIR_SE, 0} }
static

Definition at line 763 of file airport_movement.h.

◆ _airport_depots_helistation

const HangarTileTable _airport_depots_helistation[] = { {{0, 0}, DIR_SE, 0} }
static

Definition at line 792 of file airport_movement.h.

◆ _airport_depots_intercontinental

const HangarTileTable _airport_depots_intercontinental[] = { {{0, 5}, DIR_SE, 0}, {{8, 4}, DIR_SE, 1} }
static

Definition at line 651 of file airport_movement.h.

◆ _airport_depots_international

const HangarTileTable _airport_depots_international[] = { {{0, 3}, DIR_SE, 0}, {{6, 1}, DIR_SE, 1} }
static

Definition at line 584 of file airport_movement.h.

◆ _airport_depots_metropolitan

const HangarTileTable _airport_depots_metropolitan[] = { {{5, 0}, DIR_SE, 0} }
static

Definition at line 545 of file airport_movement.h.

◆ _airport_entries_city

const uint8_t _airport_entries_city[] = {26, 29, 27, 28}
static

Definition at line 506 of file airport_movement.h.

◆ _airport_entries_commuter

const uint8_t _airport_entries_commuter[] = {22, 21, 24, 23}
static

Definition at line 455 of file airport_movement.h.

◆ _airport_entries_country

const uint8_t _airport_entries_country[] = {16, 15, 18, 17}
static

Definition at line 423 of file airport_movement.h.

◆ _airport_entries_dummy

const uint8_t _airport_entries_dummy[] = {0, 1, 2, 3}
static

Definition at line 410 of file airport_movement.h.

◆ _airport_entries_helidepot

const uint8_t _airport_entries_helidepot[] = { 4, 4, 4, 4 }
static

Definition at line 764 of file airport_movement.h.

◆ _airport_entries_heliport

const uint8_t _airport_entries_heliport[] = { 7, 7, 7, 7 }
static

Definition at line 745 of file airport_movement.h.

◆ _airport_entries_helistation

const uint8_t _airport_entries_helistation[] = { 25, 25, 25, 25 }
static

Definition at line 793 of file airport_movement.h.

◆ _airport_entries_intercontinental

const uint8_t _airport_entries_intercontinental[] = { 44, 43, 46, 45 }
static

Definition at line 653 of file airport_movement.h.

◆ _airport_entries_international

const uint8_t _airport_entries_international[] = { 38, 37, 40, 39 }
static

Definition at line 586 of file airport_movement.h.

◆ _airport_entries_metropolitan

const uint8_t _airport_entries_metropolitan[] = {20, 19, 22, 21}
static

Definition at line 547 of file airport_movement.h.

◆ _airport_fta_city

const AirportFTAbuildup _airport_fta_city[]
static

Definition at line 507 of file airport_movement.h.

◆ _airport_fta_commuter

const AirportFTAbuildup _airport_fta_commuter[]
static

Definition at line 456 of file airport_movement.h.

◆ _airport_fta_country

const AirportFTAbuildup _airport_fta_country[]
static
Initial value:
= {
{ 0, HANGAR, AirportBlock::Nothing, 1 },
{ 1, TERMGROUP, AirportBlock::AirportBusy, 0 }, { 1, HANGAR, {}, 0 }, { 1, TERM1, AirportBlock::Term1, 2 }, { 1, TERM2, {}, 4 }, { 1, HELITAKEOFF, {}, 19 }, { 1, TO_ALL, {}, 6 },
{ 4, TERMGROUP, AirportBlock::AirportBusy, 0 }, { 4, TERM2, {}, 5 }, { 4, HANGAR, {}, 1 }, { 4, TAKEOFF, {}, 6 }, { 4, HELITAKEOFF, {}, 1 },
{ 5, TERMGROUP, AirportBlock::AirportBusy, 0 }, { 5, TERM2, AirportBlock::Term2, 3 }, { 5, TO_ALL, {}, 4 },
{ 6, TO_ALL, AirportBlock::AirportBusy, 7 },
{ 7, TAKEOFF, AirportBlock::AirportBusy, 8 },
{ 8, STARTTAKEOFF, AirportBlock::Nothing, 9 },
{ 9, ENDTAKEOFF, AirportBlock::Nothing, 0 },
{ 10, FLYING, AirportBlock::Nothing, 15 }, { 10, LANDING, {}, 11 }, { 10, HELILANDING, {}, 20 },
{ 11, LANDING, AirportBlock::AirportBusy, 12 },
{ 12, TO_ALL, AirportBlock::AirportBusy, 13 },
{ 13, ENDLANDING, AirportBlock::AirportBusy, 14 }, { 13, TERM2, {}, 5 }, { 13, TO_ALL, {}, 14 },
{ 14, TO_ALL, AirportBlock::AirportBusy, 1 },
{ 15, TO_ALL, AirportBlock::Nothing, 16 },
{ 16, TO_ALL, AirportBlock::Nothing, 17 },
{ 17, TO_ALL, AirportBlock::Nothing, 18 },
{ 18, TO_ALL, AirportBlock::Nothing, 10 },
{ 19, HELITAKEOFF, AirportBlock::Nothing, 0 },
{ 20, HELILANDING, AirportBlock::AirportBusy, 21 },
{ 21, HELIENDLANDING, AirportBlock::AirportBusy, 1 },
{ MAX_ELEMENTS, TO_ALL, {}, 0 }
}
static const uint MAX_ELEMENTS
maximum number of aircraft positions at airport
Definition airport.h:19
@ Term2
Block belonging to terminal 2.
@ Term1
Block belonging to terminal 1.
@ HELITAKEOFF
Helicopter wants to leave the airport.
Definition airport.h:76
@ STARTTAKEOFF
Airplane has arrived at a runway for take-off.
Definition airport.h:74
@ ENDTAKEOFF
Airplane has reached end-point of the take-off runway.
Definition airport.h:75
@ TERM2
Heading for terminal 2.
Definition airport.h:66
@ HANGAR
Heading for hangar.
Definition airport.h:64
@ FLYING
Vehicle is flying in the air.
Definition airport.h:77
@ TAKEOFF
Airplane wants to leave the airport.
Definition airport.h:73
@ HELILANDING
Helicopter wants to land.
Definition airport.h:80
@ TO_ALL
Go in this direction for every target.
Definition airport.h:63
@ ENDLANDING
Airplane wants to finish landing.
Definition airport.h:79
@ HELIENDLANDING
Helicopter wants to finish landing.
Definition airport.h:81
@ TERM1
Heading for terminal 1.
Definition airport.h:65
@ LANDING
Airplane wants to land.
Definition airport.h:78
@ TERMGROUP
Aircraft is looking for a free terminal in a terminalgroup.
Definition airport.h:86

Definition at line 424 of file airport_movement.h.

◆ _airport_fta_dummy

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

Definition at line 411 of file airport_movement.h.

◆ _airport_fta_helidepot

const AirportFTAbuildup _airport_fta_helidepot[]
static
Initial value:
= {
{ 0, HANGAR, AirportBlock::Nothing, 1 },
{ 1, TERMGROUP, AirportBlock::Hangar2Area, 0 }, { 1, HANGAR, {}, 0 }, { 1, HELIPAD1, AirportBlock::Helipad1, 14 }, { 1, HELITAKEOFF, {}, 15 }, { 1, TO_ALL, {}, 0 },
{ 2, FLYING, AirportBlock::Nothing, 3 }, { 2, HELILANDING, AirportBlock::PreHelipad, 7 }, { 2, HANGAR, {}, 12 }, { 2, HELITAKEOFF, AirportBlock::Nothing, 16 },
{ 3, TO_ALL, AirportBlock::Nothing, 4 },
{ 4, TO_ALL, AirportBlock::Nothing, 5 },
{ 5, TO_ALL, AirportBlock::Nothing, 6 },
{ 6, TO_ALL, AirportBlock::Nothing, 2 },
{ 7, HELILANDING, AirportBlock::PreHelipad, 8 },
{ 8, HELIENDLANDING, AirportBlock::PreHelipad, 8 }, { 8, HELIPAD1, {}, 9 }, { 8, HANGAR, {}, 12 }, { 8, TO_ALL, {}, 2 },
{ 9, TO_ALL, AirportBlock::Nothing, 10 },
{ 10, TERMGROUP, AirportBlock::Nothing, 10 }, { 10, HELIPAD1, AirportBlock::Helipad1, 14 }, { 10, HANGAR, {}, 1 }, { 10, TO_ALL, {}, 14 },
{ 11, HELITAKEOFF, AirportBlock::Nothing, 0 },
{ 12, TO_ALL, AirportBlock::Hangar2Area, 13 },
{ 13, TO_ALL, AirportBlock::Hangar2Area, 1 },
{ 14, HELIPAD1, AirportBlock::Helipad1, 14 }, { 14, HANGAR, {}, 1 }, { 14, HELITAKEOFF, {}, 17 },
{ 15, HELITAKEOFF, AirportBlock::Nothing, 0 },
{ 16, HELITAKEOFF, {}, 14 },
{ 17, TO_ALL, AirportBlock::Nothing, 11 },
{ MAX_ELEMENTS, TO_ALL, {}, 0 }
}
@ Helipad1
Block belonging to helipad 1.
@ HELIPAD1
Heading for helipad 1.
Definition airport.h:71

Definition at line 765 of file airport_movement.h.

◆ _airport_fta_heliport

const AirportFTAbuildup _airport_fta_heliport[]
static
Initial value:
= {
{ 1, HELITAKEOFF, AirportBlock::Nothing, 0 },
{ 2, TERMGROUP, AirportBlock::AirportBusy, 0 }, { 2, HELILANDING, {}, 3 }, { 2, HELITAKEOFF, {}, 1 },
{ 3, HELILANDING, AirportBlock::AirportBusy, 4 },
{ 4, HELIENDLANDING, AirportBlock::AirportBusy, 4 }, { 4, HELIPAD1, AirportBlock::Helipad1, 0 }, { 4, HELITAKEOFF, {}, 2 },
{ 5, TO_ALL, AirportBlock::Nothing, 6 },
{ 6, TO_ALL, AirportBlock::Nothing, 7 },
{ 7, TO_ALL, AirportBlock::Nothing, 8 },
{ 8, FLYING, AirportBlock::Nothing, 5 }, { 8, HELILANDING, AirportBlock::Helipad1, 2 },
{ MAX_ELEMENTS, TO_ALL, {}, 0 }
}

Definition at line 746 of file airport_movement.h.

◆ _airport_fta_helistation

const AirportFTAbuildup _airport_fta_helistation[]
static

Definition at line 794 of file airport_movement.h.

◆ _airport_fta_intercontinental

const AirportFTAbuildup _airport_fta_intercontinental[]
static

Definition at line 654 of file airport_movement.h.

◆ _airport_fta_international

const AirportFTAbuildup _airport_fta_international[]
static

Definition at line 587 of file airport_movement.h.

◆ _airport_fta_metropolitan

const AirportFTAbuildup _airport_fta_metropolitan[]
static

Definition at line 548 of file airport_movement.h.

◆ _airport_moving_data_city

const AirportMovingData _airport_moving_data_city[]
static

City Airport (large) 6x6.

Definition at line 115 of file airport_movement.h.

◆ _airport_moving_data_commuter

const AirportMovingData _airport_moving_data_commuter[38]
static

Commuter Airfield (small) 5x4.

Definition at line 72 of file airport_movement.h.

◆ _airport_moving_data_country

const AirportMovingData _airport_moving_data_country[22]
static
Initial value:
= {
{ 53, 27, {}, DIR_N },
{ 43, 37, {}, DIR_N },
{ 24, 37, {}, DIR_N },
{ 53, 37, {}, DIR_N },
{ 7, 40, {}, DIR_N },
{ 53, 40, {}, DIR_N },
}
@ SlowTurn
Turn slowly (mostly used in the air).
Definition airport.h:50
@ Takeoff
Takeoff movement.
Definition airport.h:49
@ Land
Landing onto landing strip.
Definition airport.h:51
@ HeliLower
Helicopter landing.
Definition airport.h:55
@ NoSpeedClamp
No speed restrictions.
Definition airport.h:48
@ Brake
Taxiing at the airport.
Definition airport.h:53
@ HeliRaise
Helicopter take-off.
Definition airport.h:54
@ ExactPosition
Go exactly to the destination coordinates.
Definition airport.h:52
@ 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:

Airport movement data creation macro.

Parameters
xX position.
yY position.
flagsMovement flags.
dirDirection. 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

◆ _airport_moving_data_helistation

const AirportMovingData _airport_moving_data_helistation[33]
static

HeliDepot 2x2 (heliport).

Definition at line 357 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 239 of file airport_movement.h.

◆ _airport_moving_data_international

const AirportMovingData _airport_moving_data_international[53]
static

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

Definition at line 181 of file airport_movement.h.

◆ _airport_moving_data_metropolitan

const AirportMovingData _airport_moving_data_metropolitan[28]
static
Initial value:
= {
{ 85, 22, {}, DIR_N },
{ 65, 6, {}, DIR_N },
{ 80, 27, {}, DIR_N },
{ 49, 58, {}, DIR_N },
{ 72, 58, {}, DIR_N },
{ 72, 69, {}, DIR_N },
{ 21, 85, {}, DIR_N },
{ 21, 69, {}, DIR_N },
{ 44, 58, {}, DIR_N },
}

Metropolitan Airport (metropolitan) - 2 runways.

Definition at line 149 of file airport_movement.h.

◆ _airport_moving_data_oilrig

◆ _airport_terminal_city

const uint8_t _airport_terminal_city[] = { 1, 3 }
static

Definition at line 505 of file airport_movement.h.

◆ _airport_terminal_commuter

const uint8_t _airport_terminal_commuter[] = { 1, 3 }
static

Definition at line 454 of file airport_movement.h.

◆ _airport_terminal_country

const uint8_t _airport_terminal_country[] = {1, 2}
static

Definition at line 422 of file airport_movement.h.

◆ _airport_terminal_intercontinental

const uint8_t _airport_terminal_intercontinental[] = { 2, 4, 4 }
static

Definition at line 652 of file airport_movement.h.

◆ _airport_terminal_international

const uint8_t _airport_terminal_international[] = { 2, 3, 3 }
static

Definition at line 585 of file airport_movement.h.

◆ _airport_terminal_metropolitan

const uint8_t _airport_terminal_metropolitan[] = { 1, 3 }
static

Definition at line 546 of file airport_movement.h.