OpenTTD Source
20241108-master-g80f628063a
|
Defines the data structure for an airport. More...
#include <newgrf_airport.h>
Public Member Functions | |
bool | IsAvailable () const |
Check whether this airport is available to build. | |
bool | IsWithinMapBounds (uint8_t table, TileIndex index) const |
Check if the airport would be within the map bounds at the given tile. More... | |
uint8_t | GetIndex () const |
Get the index of this spec. | |
Static Public Member Functions | |
static const AirportSpec * | Get (uint8_t type) |
Retrieve airport spec for the given airport. More... | |
static AirportSpec * | GetWithoutOverride (uint8_t type) |
Retrieve airport spec for the given airport. More... | |
static void | ResetAirports () |
This function initializes the airportspec array. | |
Data Fields | |
const struct AirportFTAClass * | fsm |
the finite statemachine for the default airports | |
std::vector< AirportTileLayout > | layouts |
List of layouts composing the airport. | |
std::span< const HangarTileTable > | depots |
Position of the depots on the airports. | |
uint8_t | size_x |
size of airport in x direction | |
uint8_t | size_y |
size of airport in y direction | |
uint8_t | noise_level |
noise that this airport generates | |
uint8_t | catchment |
catchment area of this airport | |
TimerGameCalendar::Year | min_year |
first year the airport is available | |
TimerGameCalendar::Year | max_year |
last year the airport is available | |
StringID | name |
name of this airport | |
TTDPAirportType | ttd_airport_type |
ttdpatch airport type (Small/Large/Helipad/Oilrig) | |
SpriteID | preview_sprite |
preview sprite for this airport | |
uint16_t | maintenance_cost |
maintenance cost multiplier | |
bool | enabled |
Entity still available (by default true). Newgrf can disable it, though. | |
struct GRFFileProps | grf_prop |
Properties related to the grf file. | |
Data Fields inherited from NewGRFSpecBase< AirportClassID > | |
AirportClassID | class_index |
Class index of this spec, invalid until class is allocated. | |
uint16_t | index |
Index within class of this spec, invalid until inserted into class. | |
Static Public Attributes | |
static const AirportSpec | dummy = AS_GENERIC(&_airportfta_dummy, {}, {}, 0, 0, 0, 0, CalendarTime::MIN_YEAR, CalendarTime::MIN_YEAR, 0, ATP_TTDP_LARGE, APC_BEGIN, STR_NULL, 0, false) |
The dummy airport. | |
Static Private Attributes | |
static AirportSpec | specs [NUM_AIRPORTS] |
Specs of the airports. More... | |
Defines the data structure for an airport.
Definition at line 105 of file newgrf_airport.h.
|
static |
Retrieve airport spec for the given airport.
If an override is available it is returned.
type | index of airport |
Definition at line 55 of file newgrf_airport.cpp.
References enabled, lengthof, NEW_AIRPORT_OFFSET, and specs.
Referenced by GetAirport(), NIHAirport::GetGRFID(), Airport::GetSpec(), NIHAirport::GetSpec(), NIHAirport::IsInspectable(), and NIHAirport::Resolve().
|
static |
Retrieve airport spec for the given airport.
Even if an override is available the base spec is returned.
type | index of airport |
Definition at line 75 of file newgrf_airport.cpp.
References lengthof, and specs.
Referenced by BindAirportSpecs().
bool AirportSpec::IsWithinMapBounds | ( | uint8_t | table, |
TileIndex | tile | ||
) | const |
Check if the airport would be within the map bounds at the given tile.
table | Selected layout table. This affects airport rotation, and therefore dimensions. |
tile | Top corner of the airport. |
Definition at line 96 of file newgrf_airport.cpp.
References DIR_E, DIR_W, layouts, size_x, size_y, Map::SizeX(), Map::SizeY(), Swap(), TileX(), and TileY().
|
staticprivate |
Specs of the airports.
Airport specifications.
Definition at line 141 of file newgrf_airport.h.
Referenced by Get(), GetIndex(), and GetWithoutOverride().