# airport.cpp File Reference

Functions related to airports. More...

`#include "stdafx.h"`
`#include "debug.h"`
`#include "airport.h"`
`#include "airport_movement.h"`
`#include "core/bitmath_func.hpp"`
`#include "core/alloc_func.hpp"`
`#include "date_func.h"`
`#include "settings_type.h"`

Go to the source code of this file.

## Functions

void | InitializeAirports ()
void | UnInitializeAirports ()
static uint16 | AirportGetNofElements (const AirportFTAbuildup *apFA)
| Get the number of elements of a source Airport state automata Since it is actually just a big array of AirportFTA types, we only know one element from the other by differing 'position' identifiers.
static AirportFTA * | AirportBuildAutomata (uint nofelements, const AirportFTAbuildup *apFA)
static byte | AirportGetTerminalCount (const byte *terminals, byte *groups)
| We calculate the terminal/helipod count based on the data passed to us This data (terminals) contains an index as a first element as to how many groups there are, and then the number of terminals for each group.
static byte | AirportTestFTA (uint nofelements, const AirportFTA *layout, const byte *terminals)
const AirportFTAClass * | GetAirport (const byte airport_type)
uint32 | GetValidAirports ()
| Get buildable airport bitmask.

## Variables

static AirportFTAClass * | DummyAirport
static AirportFTAClass * | CountryAirport
static AirportFTAClass * | CityAirport
static AirportFTAClass * | Oilrig
static AirportFTAClass * | Heliport
static AirportFTAClass * | MetropolitanAirport
static AirportFTAClass * | InternationalAirport
static AirportFTAClass * | CommuterAirport
static AirportFTAClass * | HeliDepot
static AirportFTAClass * | IntercontinentalAirport
static AirportFTAClass * | HeliStation

## Detailed Description

Functions related to airports.

Definition in file airport.cpp.

## Function Documentation

uint32 GetValidAirports | ( |  | ) |

Get buildable airport bitmask.

Returns:
  get all buildable airports at this given time, bitmasked. Bit 0 means the small airport is buildable, etc.

Todo:
  set availability of airports by year, instead of airplane

Definition at line 475 of file airport.cpp.

References _cur_year, _settings_game, StationSettings::always_small_airport, SetBit(), and GameSettings::station.

Referenced by CmdBuildAirport(), and AIAirport::IsValidAirportType().