OpenTTD Source
20241108-master-g80f628063a
|
All airport-related information. More...
#include <station_base.h>
Public Member Functions | |
const AirportSpec * | GetSpec () const |
Get the AirportSpec that from the airport type of this airport. More... | |
const AirportFTAClass * | GetFTA () const |
Get the finite-state machine for this airport or the finite-state machine for the dummy airport in case this isn't an airport. More... | |
bool | HasHangar () const |
Check if this airport has at least one hangar. | |
TileIndex | GetRotatedTileFromOffset (TileIndexDiffC tidc) const |
Add the tileoffset to the base tile of this airport but rotate it first. More... | |
TileIndex | GetHangarTile (uint hangar_num) const |
Get the first tile of the given hangar. More... | |
Direction | GetHangarExitDirection (TileIndex tile) const |
Get the exit direction of the hangar at a specific tile. More... | |
uint | GetHangarNum (TileIndex tile) const |
Get the hangar number of the hangar at a specific tile. More... | |
uint | GetNumHangars () const |
Get the number of hangars on this airport. | |
Public Member Functions inherited from OrthogonalTileArea | |
OrthogonalTileArea (TileIndex tile=INVALID_TILE, uint16_t w=0, uint16_t h=0) | |
Construct this tile area with some set values. More... | |
OrthogonalTileArea (TileIndex start, TileIndex end) | |
Construct this tile area based on two points. More... | |
void | Add (TileIndex to_add) |
Add a single tile to a tile area; enlarge if needed. More... | |
void | Clear () |
Clears the 'tile area', i.e. More... | |
bool | Intersects (const OrthogonalTileArea &ta) const |
Does this tile area intersect with another? More... | |
bool | Contains (TileIndex tile) const |
Does this tile area contain a tile? More... | |
OrthogonalTileArea & | Expand (int rad) |
Expand a tile area by rad tiles in each direction, keeping within map bounds. More... | |
void | ClampToMap () |
Clamp the tile area to map borders. | |
TileIndex | GetCenterTile () const |
Get the center tile. More... | |
OrthogonalTileIterator | begin () const |
Returns an iterator to the beginning of the tile area. More... | |
OrthogonalTileIterator | end () const |
Returns an iterator to the end of the tile area. More... | |
Data Fields | |
uint64_t | flags |
stores which blocks on the airport are taken. was 16 bit earlier on, then 32 | |
uint8_t | type |
Type of this airport,. More... | |
uint8_t | layout |
Airport layout number. | |
Direction | rotation |
How this airport is rotated. | |
PersistentStorage * | psa |
Persistent storage for NewGRF airports. | |
Data Fields inherited from OrthogonalTileArea | |
TileIndex | tile |
The base tile of the area. | |
uint16_t | w |
The width of the area. | |
uint16_t | h |
The height of the area. | |
Private Member Functions | |
const HangarTileTable * | GetHangarDataByTile (TileIndex tile) const |
Retrieve hangar information of a hangar at a given tile. More... | |
All airport-related information.
Only valid if tile != INVALID_TILE.
Definition at line 290 of file station_base.h.
|
inline |
Get the finite-state machine for this airport or the finite-state machine for the dummy airport in case this isn't an airport.
Definition at line 317 of file station_base.h.
References AirportSpec::fsm, and GetSpec().
Referenced by AircraftController(), CanVehicleUseStation(), FloodVehicleProc(), GetVehiclePosOnBuild(), MaybeCrashAirplane(), and UpdateAirplanesOnNewStation().
|
inlineprivate |
Retrieve hangar information of a hangar at a given tile.
tile | Tile containing the hangar. |
Definition at line 414 of file station_base.h.
References GetRotatedTileFromOffset(), GetSpec(), and OrthogonalTileArea::tile.
Referenced by GetHangarExitDirection(), and GetHangarNum().
Get the exit direction of the hangar at a specific tile.
tile | The tile to query. |
Definition at line 374 of file station_base.h.
References ChangeDir(), HangarTileTable::dir, DirDifference(), GetHangarDataByTile(), GetSpec(), AirportSpec::layouts, and OrthogonalTileArea::tile.
|
inline |
Get the hangar number of the hangar at a specific tile.
tile | The tile to query. |
Definition at line 387 of file station_base.h.
References GetHangarDataByTile(), HangarTileTable::hangar_num, and OrthogonalTileArea::tile.
Referenced by CmdBuildAircraft().
|
inline |
Get the first tile of the given hangar.
hangar_num | The hangar to get the location of. |
Definition at line 358 of file station_base.h.
References GetRotatedTileFromOffset(), and GetSpec().
Referenced by CmdBuildAircraft(), GetVehiclePosOnBuild(), and RemoveAirport().
|
inline |
Add the tileoffset to the base tile of this airport but rotate it first.
The base tile is the northernmost tile of this airport. This function helps to make sure that getting the tile of a hangar works even for rotated airport layouts without requiring a rotated array of hangar tiles.
tidc | The tilediff to add to the airport tile. |
Definition at line 336 of file station_base.h.
References DIR_E, DIR_N, DIR_S, DIR_W, GetSpec(), AirportSpec::size_x, AirportSpec::size_y, OrthogonalTileArea::tile, TileDiffXY(), ToTileIndexDiff(), TileIndexDiffC::x, and TileIndexDiffC::y.
Referenced by GetHangarDataByTile(), GetHangarTile(), and IsHangar().
|
inline |
Get the AirportSpec that from the airport type of this airport.
If there is no airport (tile
== INVALID_TILE) then return the dummy AirportSpec.
Definition at line 305 of file station_base.h.
References AirportSpec::dummy, AirportSpec::Get(), INVALID_TILE, and OrthogonalTileArea::tile.
Referenced by AirportGetNearestTown(), Station::GetCatchmentRadius(), GetFTA(), GetHangarDataByTile(), GetHangarExitDirection(), GetHangarTile(), GetNumHangars(), GetRotatedTileFromOffset(), HasHangar(), IsHangar(), and RemoveAirport().
uint8_t Airport::type |
Type of this airport,.
Definition at line 294 of file station_base.h.
Referenced by AirportTileScopeResolver::AirportTileScopeResolver(), and NIHAirport::Resolve().