OpenTTD Source 20250312-master-gcdcc6b491d
|
Various declarations for airports. More...
Go to the source code of this file.
Data Structures | |
struct | AirportMovingData |
A single location on an airport where aircraft can move to. More... | |
struct | AirportFTA |
Internal structure used in openttd - Finite sTate mAchine --> FTA. More... | |
struct | AirportFTAClass |
Finite sTate mAchine (FTA) of an airport. More... | |
Typedefs | |
using | AirportMovingDataFlags = EnumBitSet< AirportMovingDataFlag, uint16_t > |
using | AirportBlocks = EnumBitSet< AirportBlock, uint64_t > |
Enumerations | |
enum | AirportTypes : uint8_t { AT_SMALL = 0 , AT_LARGE = 1 , AT_HELIPORT = 2 , AT_METROPOLITAN = 3 , AT_INTERNATIONAL = 4 , AT_COMMUTER = 5 , AT_HELIDEPOT = 6 , AT_INTERCON = 7 , AT_HELISTATION = 8 , AT_OILRIG = 9 , NEW_AIRPORT_OFFSET = 10 , NUM_AIRPORTS_PER_GRF = 128 , NUM_AIRPORTS = 128 , AT_INVALID = 254 , AT_DUMMY = 255 } |
Airport types. More... | |
enum | AirportMovingDataFlag : uint8_t { NoSpeedClamp , Takeoff , SlowTurn , Land , ExactPosition , Brake , HeliRaise , HeliLower , Hold } |
Flags for airport movement data. More... | |
enum | AirportMovementStates : uint8_t { TO_ALL = 0 , HANGAR = 1 , TERM1 = 2 , TERM2 = 3 , TERM3 = 4 , TERM4 = 5 , TERM5 = 6 , TERM6 = 7 , HELIPAD1 = 8 , HELIPAD2 = 9 , TAKEOFF = 10 , STARTTAKEOFF = 11 , ENDTAKEOFF = 12 , HELITAKEOFF = 13 , FLYING = 14 , LANDING = 15 , ENDLANDING = 16 , HELILANDING = 17 , HELIENDLANDING = 18 , TERM7 = 19 , TERM8 = 20 , HELIPAD3 = 21 , MAX_HEADINGS = 21 , TERMGROUP = 255 } |
Movement States on Airports (headings target) More... | |
enum class | AirportBlock : uint8_t { Term1 = 0 , Term2 = 1 , Term3 = 2 , Term4 = 3 , Term5 = 4 , Term6 = 5 , Helipad1 = 6 , Helipad2 = 7 , RunwayInOut = 8 , RunwayIn = 8 , AirportBusy = 8 , RunwayOut = 9 , TaxiwayBusy = 10 , OutWay = 11 , InWay = 12 , AirportEntrance = 13 , TermGroup1 = 14 , TermGroup2 = 15 , Hangar2Area = 16 , TermGroup2Enter1 = 17 , TermGroup2Enter2 = 18 , TermGroup2Exit1 = 19 , TermGroup2Exit2 = 20 , PreHelipad = 21 , Term7 = 22 , Term8 = 23 , Helipad3 = 24 , Hangar1Area = 26 , OutWay2 = 27 , InWay2 = 28 , RunwayIn2 = 29 , RunwayOut2 = 10 , HelipadGroup = 13 , OutWay3 = 31 , Nothing = 30 , AirportClosed = 63 } |
Movement Blocks on Airports blocks (eg_airport_flags). More... | |
Functions | |
AirportMovingData | RotateAirportMovingData (const AirportMovingData *orig, Direction rotation, uint num_tiles_x, uint num_tiles_y) |
Rotate the airport moving data to another rotation. | |
const AirportFTAClass * | GetAirport (const uint8_t airport_type) |
Get the finite state machine of an airport type. | |
uint8_t | GetVehiclePosOnBuild (TileIndex hangar_tile) |
Get the vehicle position when an aircraft is build at the given tile. | |
Variables | |
static const uint | MAX_TERMINALS = 8 |
Some airport-related constants. | |
static const uint | MAX_HELIPADS = 3 |
maximum number of helipads per airport | |
static const uint | MAX_ELEMENTS = 255 |
maximum number of aircraft positions at airport | |
static const uint | NUM_AIRPORTTILES_PER_GRF = 255 |
Number of airport tiles per NewGRF; limited to 255 to allow extending Action3 with an extended byte later on. | |
static const uint | NUM_AIRPORTTILES = 256 |
Total number of airport tiles. | |
static const uint | NEW_AIRPORTTILE_OFFSET = 74 |
offset of first newgrf airport tile | |
static const uint | INVALID_AIRPORTTILE = NUM_AIRPORTTILES |
id for an invalid airport tile | |
Various declarations for airports.
Definition in file airport.h.
using AirportBlocks = EnumBitSet<AirportBlock, uint64_t> |
using AirportMovingDataFlags = EnumBitSet<AirportMovingDataFlag, uint16_t> |
|
strong |
Movement Blocks on Airports blocks (eg_airport_flags).
enum AirportMovementStates : uint8_t |
Movement States on Airports (headings target)
Enumerator | |
---|---|
TO_ALL | Go in this direction for every target. |
HANGAR | Heading for hangar. |
TERM1 | Heading for terminal 1. |
TERM2 | Heading for terminal 2. |
TERM3 | Heading for terminal 3. |
TERM4 | Heading for terminal 4. |
TERM5 | Heading for terminal 5. |
TERM6 | Heading for terminal 6. |
HELIPAD1 | Heading for helipad 1. |
HELIPAD2 | Heading for helipad 2. |
TAKEOFF | Airplane wants to leave the airport. |
STARTTAKEOFF | Airplane has arrived at a runway for take-off. |
ENDTAKEOFF | Airplane has reached end-point of the take-off runway. |
HELITAKEOFF | Helicopter wants to leave the airport. |
FLYING | Vehicle is flying in the air. |
LANDING | Airplane wants to land. |
ENDLANDING | Airplane wants to finish landing. |
HELILANDING | Helicopter wants to land. |
HELIENDLANDING | Helicopter wants to finish landing. |
TERM7 | Heading for terminal 7. |
TERM8 | Heading for terminal 8. |
HELIPAD3 | Heading for helipad 3. |
MAX_HEADINGS | Last valid target to head for. |
TERMGROUP | Aircraft is looking for a free terminal in a terminalgroup. |
enum AirportMovingDataFlag : uint8_t |
Flags for airport movement data.
enum AirportTypes : uint8_t |
Airport types.
const AirportFTAClass * GetAirport | ( | const uint8_t | airport_type | ) |
Get the finite state machine of an airport type.
airport_type | Airport type to query FTA from. |
Definition at line 185 of file airport.cpp.
References AT_DUMMY, AirportSpec::fsm, and AirportSpec::Get().
Referenced by AircraftController(), AircraftNextAirportPos_and_Order(), and CmdBuildAirport().
uint8_t GetVehiclePosOnBuild | ( | TileIndex | hangar_tile | ) |
Get the vehicle position when an aircraft is build at the given tile.
hangar_tile | The tile on which the vehicle is build |
Definition at line 196 of file airport.cpp.
References Station::airport, BaseStation::GetByTile(), Airport::GetFTA(), Airport::GetHangarTile(), HANGAR, and AirportFTAClass::layout.
Referenced by CmdBuildAircraft().
AirportMovingData RotateAirportMovingData | ( | const AirportMovingData * | orig, |
Direction | rotation, | ||
uint | num_tiles_x, | ||
uint | num_tiles_y | ||
) |
Rotate the airport moving data to another rotation.
orig | Pointer to the moving data to rotate. |
rotation | How to rotate the moving data. |
num_tiles_x | Number of tiles in x direction. |
num_tiles_y | Number of tiles in y direction. |
Definition at line 80 of file airport.cpp.
References ChangeDir(), DIR_E, DIR_N, DIR_S, DIR_W, AirportMovingData::direction, AirportMovingData::flags, TILE_SIZE, AirportMovingData::x, and AirportMovingData::y.
Referenced by AircraftController().
|
static |
id for an invalid airport tile
Definition at line 25 of file airport.h.
Referenced by AirportChangeInfo(), GetAirportTileIDAtOffset(), and GetTranslatedAirportTileID().
|
static |
maximum number of aircraft positions at airport
Definition at line 19 of file airport.h.
Referenced by AirportGetNofElements().
|
static |
|
static |
Some airport-related constants.
maximum number of terminals per airport
Definition at line 17 of file airport.h.
Referenced by AirportFindFreeHelipad().
|
static |
offset of first newgrf airport tile
Definition at line 24 of file airport.h.
Referenced by GetAirportTileIDAtOffset().
|
static |