|
OpenTTD Source 20261129-master-g72a8bdc861
|
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. | |
| 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. | |
| 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. | |
| TileIndex | GetHangarTile (uint hangar_num) const |
| Get the first tile of the given hangar. | |
| Direction | GetHangarExitDirection (TileIndex tile) const |
| Get the exit direction of the hangar at a specific tile. | |
| uint | GetHangarNum (TileIndex tile) const |
| Get the hangar number of the hangar at a specific tile. | |
| 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. | |
| OrthogonalTileArea (TileIndex start, TileIndex end) | |
| Construct this tile area based on two points. | |
| bool | IsEmpty () const |
| Test if this tile area is empty. | |
| void | Add (TileIndex to_add) |
| Add a single tile to a tile area; enlarge if needed. | |
| void | Add (const OrthogonalTileArea &area) |
| Add another tile area to this tile area. | |
| void | Clear () |
| Clears the 'tile area', i.e. | |
| bool | Intersects (const OrthogonalTileArea &ta) const |
| Does this tile area intersect with another? | |
| bool | Contains (TileIndex tile) const |
| Does this tile area contain a tile? | |
| OrthogonalTileArea & | Expand (int rad) |
| Expand a tile area by rad tiles in each direction, keeping within map bounds. | |
| void | ClampToMap () |
| Clamp the tile area to map borders. | |
| TileIndex | GetCentreTile () const |
| Get the centre tile. | |
| iterator | begin () const |
| Returns an iterator to the start of the tile area. | |
| std::default_sentinel_t | end () const |
| Returns an iterator to the end of the tile area. | |
Data Fields | |
| AirportBlocks | blocks {} |
| stores which blocks on the airport are taken. was 16 bit earlier on, then 32 | |
| uint8_t | type = 0 |
| Type of this airport,. | |
| uint8_t | layout = 0 |
| Airport layout number. | |
| Direction | rotation = Direction::Invalid |
| How this airport is rotated. | |
| PersistentStorage * | psa = nullptr |
| 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. | |
All airport-related information.
Only valid if tile != INVALID_TILE.
Definition at line 432 of file station_base.h.
|
inline |
Definition at line 433 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 459 of file station_base.h.
References AirportSpec::fsm, and GetSpec().
Referenced by AircraftController(), AircraftNextAirportPos_and_Order(), CanVehicleUseStation(), CheckOrders(), FloodVehicleProc(), GetVehiclePosOnBuild(), MapAircraftMovementState(), MaybeCrashAirplane(), Vehicle::PreDestructor(), and UpdateAirplanesOnNewStation().
|
inlineprivate |
Retrieve hangar information of a hangar at a given tile.
| tile | Tile containing the hangar. |
Definition at line 562 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 519 of file station_base.h.
References ChangeDir(), HangarTileTable::dir, DirDifference(), GetHangarDataByTile(), GetSpec(), AirportSpec::layouts, and OrthogonalTileArea::tile.
Referenced by AircraftEventHandler_InHangar().
|
inline |
Get the hangar number of the hangar at a specific tile.
| tile | The tile to query. |
Definition at line 532 of file station_base.h.
References GetHangarDataByTile(), HangarTileTable::hangar_num, and OrthogonalTileArea::tile.
Referenced by ClickTile_Station().
|
inline |
Get the first tile of the given hangar.
| hangar_num | The hangar to get the location of. |
Definition at line 503 of file station_base.h.
References GetRotatedTileFromOffset(), and GetSpec().
Referenced by AircraftController(), ClickTile_Station(), GetVehiclePosOnBuild(), and RemoveAirport().
|
inline |
Get the number of hangars on this airport.
Definition at line 542 of file station_base.h.
References GetSpec(), HasBit(), and SetBit().
Referenced by 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 481 of file station_base.h.
References E, GetSpec(), N, S, AirportSpec::size_x, AirportSpec::size_y, OrthogonalTileArea::tile, TileDiffXY(), ToTileIndexDiff(), W, 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 447 of file station_base.h.
References AirportSpec::dummy, AirportSpec::Get(), INVALID_TILE, and OrthogonalTileArea::tile.
Referenced by AirportGetNearestTown(), GetFTA(), GetHangarDataByTile(), GetHangarExitDirection(), GetHangarTile(), GetNumHangars(), GetRotatedTileFromOffset(), GetTileCatchmentRadius(), HasHangar(), IsHangar(), and RemoveAirport().
|
inline |
Check if this airport has at least one hangar.
true iff there are one or more hangars. Definition at line 468 of file station_base.h.
References AirportSpec::depots, and GetSpec().
Referenced by AircraftController(), AircraftEventHandler_HeliEndLanding(), CmdInsertOrder(), Aircraft::FindClosestDepot(), and UpdateAirplanesOnNewStation().
| AirportBlocks Airport::blocks {} |
stores which blocks on the airport are taken. was 16 bit earlier on, then 32
Definition at line 435 of file station_base.h.
Referenced by AircraftController(), AircraftEventHandler_Flying(), AirportFindFreeTerminal(), AirportHasBlock(), AirportSetBlocks(), CmdBuildAirport(), CmdOpenCloseAirport(), DisasterTick_Zeppeliner(), FreeTerminal(), HandleCrashedAircraft(), StationViewWindow::OnPaint(), and Vehicle::PreDestructor().
| uint8_t Airport::layout = 0 |
Airport layout number.
Definition at line 437 of file station_base.h.
Referenced by CmdBuildAirport(), and NIHAirport::Resolve().
| PersistentStorage* Airport::psa = nullptr |
Persistent storage for NewGRF airports.
Definition at line 440 of file station_base.h.
Referenced by NIHAirport::GetPSA(), SlStationGoods::Load(), and RemoveAirport().
| Direction Airport::rotation = Direction::Invalid |
How this airport is rotated.
Definition at line 438 of file station_base.h.
Referenced by AircraftController(), AircraftNextAirportPos_and_Order(), AirportGetNearestTown(), CmdBuildAirport(), and UpdateAirplanesOnNewStation().
| uint8_t Airport::type = 0 |
Type of this airport,.
Definition at line 436 of file station_base.h.
Referenced by AircraftController(), CmdBuildAirport(), and NIHAirport::Resolve().