Functions related to airports. More...
#include "stdafx.h"#include "station_base.h"#include "table/strings.h"#include "table/airport_movement.h"#include "table/airporttile_ids.h"#include "table/airport_defaults.h"Go to the source code of this file.
Defines | |
| #define | AIRPORT_GENERIC(name, terminals, num_helipads, flags, delta_z) |
| Define a generic airport. | |
| #define | AIRPORT(name, num_helipads, short_strip) AIRPORT_GENERIC(name, _airport_terminal_ ## name, num_helipads, AirportFTAClass::ALL | (short_strip ? AirportFTAClass::SHORT_STRIP : (AirportFTAClass::Flags)0), 0) |
| Define an airport. | |
| #define | HELIPORT(name, num_helipads, delta_z) AIRPORT_GENERIC(name, NULL, num_helipads, AirportFTAClass::HELICOPTERS, delta_z) |
| Define a heliport. | |
Functions | |
| 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) |
| Construct the FTA given a description. | |
| 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 byte airport_type) |
| Get the finite state machine of an airport type. | |
| byte | GetVehiclePosOnBuild (TileIndex hangar_tile) |
| Get the vehicle position when an aircraft is build at the given tile. | |
Functions related to airports.
Definition in file airport.cpp.
| #define AIRPORT | ( | name, | ||
| num_helipads, | ||||
| short_strip | ||||
| ) | AIRPORT_GENERIC(name, _airport_terminal_ ## name, num_helipads, AirportFTAClass::ALL | (short_strip ? AirportFTAClass::SHORT_STRIP : (AirportFTAClass::Flags)0), 0) |
Define an airport.
| name | Suffix of the names of the airport data. | |
| num_helipads | Number of heli pads. | |
| short_strip | Airport has a short land/take-off strip. |
Definition at line 37 of file airport.cpp.
| #define AIRPORT_GENERIC | ( | name, | ||
| terminals, | ||||
| num_helipads, | ||||
| flags, | ||||
| delta_z | ||||
| ) |
static AirportFTAClass _airportfta_ ## name(_airport_moving_data_ ## name, terminals, \ num_helipads, _airport_entries_ ## name, flags, _airport_fta_ ## name, delta_z);
Define a generic airport.
| name | Suffix of the names of the airport data. | |
| terminals | The terminals. | |
| num_helipads | Number of heli pads. | |
| flags | Information about the class of FTA. | |
| delta_z | Height of the arport above the land. |
Definition at line 27 of file airport.cpp.
| #define HELIPORT | ( | name, | ||
| num_helipads, | ||||
| delta_z | ||||
| ) | AIRPORT_GENERIC(name, NULL, num_helipads, AirportFTAClass::HELICOPTERS, delta_z) |
Define a heliport.
| name | Suffix of the names of the helipad data. | |
| num_helipads | Number of heli pads. | |
| delta_z | Height of the arport above the land. |
Definition at line 46 of file airport.cpp.
| static AirportFTA * AirportBuildAutomata | ( | uint | nofelements, | |
| const AirportFTAbuildup * | apFA | |||
| ) | [static] |
Construct the FTA given a description.
| nofelements | The number of elements in the FTA. | |
| apFA | The description of the FTA. |
Definition at line 171 of file airport.cpp.
References AirportFTAbuildup::block, AirportFTA::block, AirportFTAbuildup::heading, AirportFTA::heading, AirportFTA::next, AirportFTAbuildup::next, AirportFTA::next_position, AirportFTAbuildup::position, and AirportFTA::position.
| const AirportFTAClass* GetAirport | ( | const byte | airport_type | ) |
Get the finite state machine of an airport type.
| airport_type | Airport type to query FTA from. |
Definition at line 207 of file airport.cpp.
References AT_DUMMY, AirportSpec::fsm, and AirportSpec::Get().
Referenced by AircraftController(), AircraftNextAirportPos_and_Order(), and CmdBuildAirport().
| byte 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 218 of file airport.cpp.
References Station::airport, SpecializedStation< Station, false >::GetByTile(), Airport::GetFTA(), Airport::GetHangarTile(), HANGAR, AirportFTA::heading, AirportFTAClass::layout, and AirportFTA::position.
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::flag, TILE_SIZE, AirportMovingData::x, and AirportMovingData::y.
Referenced by AircraftController().
1.7.1