OpenTTD Source 20241224-master-gf74b0cf984
AirportFTAClass Struct Reference

Finite sTate mAchine (FTA) of an airport. More...

#include <airport.h>

Public Types

enum  Flags { AIRPLANES = 0x1 , HELICOPTERS = 0x2 , ALL = AIRPLANES | HELICOPTERS , SHORT_STRIP = 0x4 }
 Bitmask of airport flags. More...
 

Public Member Functions

 AirportFTAClass (const AirportMovingData *moving_data, const uint8_t *terminals, const uint8_t num_helipads, const uint8_t *entry_points, Flags flags, const AirportFTAbuildup *apFA, uint8_t delta_z)
 
const AirportMovingDataMovingData (uint8_t position) const
 Get movement data at a position.
 

Data Fields

const AirportMovingDatamoving_data
 Movement data.
 
struct AirportFTAlayout
 state machine for airport
 
const uint8_t * terminals
 Array with the number of terminal groups, followed by the number of terminals in each group.
 
const uint8_t num_helipads
 Number of helipads on this airport. When 0 helicopters will go to normal terminals.
 
Flags flags
 Flags for this airport type.
 
uint8_t nofelements
 number of positions the airport consists of
 
const uint8_t * entry_points
 when an airplane arrives at this airport, enter it at position entry_point, index depends on direction
 
uint8_t delta_z
 Z adjustment for helicopter pads.
 

Detailed Description

Finite sTate mAchine (FTA) of an airport.

Definition at line 143 of file airport.h.

Member Enumeration Documentation

◆ Flags

Bitmask of airport flags.

Enumerator
AIRPLANES 

Can planes land on this airport type?

HELICOPTERS 

Can helicopters land on this airport type?

ALL 

Mask to check for both planes and helicopters.

SHORT_STRIP 

This airport has a short landing strip, dangerous for fast aircraft.

Definition at line 146 of file airport.h.

Constructor & Destructor Documentation

◆ AirportFTAClass()

AirportFTAClass::AirportFTAClass ( const AirportMovingData moving_data,
const uint8_t *  terminals,
const uint8_t  num_helipads,
const uint8_t *  entry_points,
Flags  flags,
const AirportFTAbuildup apFA,
uint8_t  delta_z 
)

Definition at line 111 of file airport.cpp.

◆ ~AirportFTAClass()

AirportFTAClass::~AirportFTAClass ( )

Definition at line 132 of file airport.cpp.

Member Function Documentation

◆ MovingData()

const AirportMovingData * AirportFTAClass::MovingData ( uint8_t  position) const
inline

Get movement data at a position.

Parameters
positionElement number to get movement data about.
Returns
Pointer to the movement data.

Definition at line 170 of file airport.h.

References moving_data, and nofelements.

Referenced by AircraftController(), and MapAircraftMovementState().

Field Documentation

◆ delta_z

uint8_t AirportFTAClass::delta_z

Z adjustment for helicopter pads.

Definition at line 183 of file airport.h.

Referenced by AircraftController(), FloodVehicleProc(), and MapAircraftMovementState().

◆ entry_points

const uint8_t* AirportFTAClass::entry_points

when an airplane arrives at this airport, enter it at position entry_point, index depends on direction

Definition at line 182 of file airport.h.

Referenced by AircraftGetEntryPoint().

◆ flags

Flags AirportFTAClass::flags

Flags for this airport type.

Definition at line 180 of file airport.h.

Referenced by CanVehicleUseStation(), CheckOrders(), FindNearestHangar(), and MaybeCrashAirplane().

◆ layout

◆ moving_data

const AirportMovingData* AirportFTAClass::moving_data

Movement data.

Definition at line 176 of file airport.h.

Referenced by MovingData().

◆ nofelements

uint8_t AirportFTAClass::nofelements

number of positions the airport consists of

Definition at line 181 of file airport.h.

Referenced by AircraftController(), and MovingData().

◆ num_helipads

const uint8_t AirportFTAClass::num_helipads

Number of helipads on this airport. When 0 helicopters will go to normal terminals.

Definition at line 179 of file airport.h.

Referenced by AircraftEventHandler_AtTerminal(), and AirportFindFreeHelipad().

◆ terminals

const uint8_t* AirportFTAClass::terminals

Array with the number of terminal groups, followed by the number of terminals in each group.

Definition at line 178 of file airport.h.

Referenced by AirportFindFreeTerminal(), and GetNumTerminals().


The documentation for this struct was generated from the following files: