OpenTTD AI API 20241220-master-g59680867c3
|
Class that handles all airport related functions. More...
#include <script_airport.hpp>
Public Types | |
enum | AirportType { AT_SMALL , AT_LARGE , AT_METROPOLITAN , AT_INTERNATIONAL , AT_COMMUTER , AT_INTERCON , AT_HELIPORT , AT_HELISTATION , AT_HELIDEPOT , AT_INVALID } |
The types of airports available in the game. More... | |
enum | PlaneType { PT_HELICOPTER , PT_SMALL_PLANE , PT_BIG_PLANE , PT_INVALID } |
All plane types available. More... | |
Static Public Member Functions | |
static bool | IsValidAirportType (AirportType type) |
Checks whether the given AirportType is valid and available. | |
static bool | IsAirportInformationAvailable (AirportType type) |
Can you get information on this airport type? As opposed to IsValidAirportType this will return also return true when an airport type is no longer buildable. | |
static Money | GetPrice (AirportType type) |
Get the cost to build this AirportType. | |
static bool | IsHangarTile (TileIndex tile) |
Checks whether the given tile is actually a tile with a hangar. | |
static bool | IsAirportTile (TileIndex tile) |
Checks whether the given tile is actually a tile with an airport. | |
static int | GetAirportWidth (AirportType type) |
Get the width of this type of airport. | |
static int | GetAirportHeight (AirportType type) |
Get the height of this type of airport. | |
static int | GetAirportCoverageRadius (AirportType type) |
Get the coverage radius of this type of airport. | |
static int | GetNumHangars (TileIndex tile) |
Get the number of hangars of the airport. | |
static TileIndex | GetHangarOfAirport (TileIndex tile) |
Get the first hangar tile of the airport. | |
static bool | BuildAirport (TileIndex tile, AirportType type, StationID station_id) |
Builds a airport with tile at the topleft corner. | |
static bool | RemoveAirport (TileIndex tile) |
Removes an airport. | |
static AirportType | GetAirportType (TileIndex tile) |
Get the AirportType of an existing airport. | |
static int | GetNoiseLevelIncrease (TileIndex tile, AirportType type) |
Get the noise that will be added to the nearest town if an airport was built at this tile. | |
static TownID | GetNearestTown (TileIndex tile, AirportType type) |
Get the TownID of the town whose local authority will influence an airport at some tile. | |
static int | GetMaintenanceCostFactor (AirportType type) |
Get the maintenance cost factor of an airport type. | |
static Money | GetMonthlyMaintenanceCost (AirportType type) |
Get the monthly maintenance cost of an airport type. | |
static int | GetAirportNumHelipads (AirportType type) |
Get the number of helipads of this airport type. | |
Class that handles all airport related functions.
The types of airports available in the game.
enum AIAirport::PlaneType |
|
static |
Builds a airport with tile at the topleft corner.
tile | The topleft corner of the airport. |
type | The type of airport to build. |
station_id | The station to join, AIStation::STATION_NEW or AIStation::STATION_JOIN_ADJACENT. |
AIError::ERR_AREA_NOT_CLEAR | |
AIError::ERR_FLAT_LAND_REQUIRED | |
AIError::ERR_LOCAL_AUTHORITY_REFUSES | |
AIStation::ERR_STATION_TOO_LARGE | |
AIStation::ERR_STATION_TOO_CLOSE_TO_ANOTHER_STATION |
|
static |
Get the coverage radius of this type of airport.
type | The type of airport. |
|
static |
Get the height of this type of airport.
type | The type of airport. |
|
static |
Get the number of helipads of this airport type.
type | The airport type. |
|
static |
Get the AirportType of an existing airport.
tile | Any tile of the airport. |
|
static |
Get the width of this type of airport.
type | The type of airport. |
Get the first hangar tile of the airport.
tile | Any tile of the airport. |
|
static |
Get the maintenance cost factor of an airport type.
type | The airport type to get the maintenance factor of. |
|
static |
Get the monthly maintenance cost of an airport type.
type | The airport type to get the monthly maintenance cost of. |
|
static |
Get the TownID of the town whose local authority will influence an airport at some tile.
tile | The tile to check. |
type | The AirportType to check. |
|
static |
Get the noise that will be added to the nearest town if an airport was built at this tile.
tile | The tile to check. |
type | The AirportType to check. |
|
static |
Get the number of hangars of the airport.
tile | Any tile of the airport. |
|
static |
Get the cost to build this AirportType.
type | The AirportType to check. |
|
static |
Can you get information on this airport type? As opposed to IsValidAirportType this will return also return true when an airport type is no longer buildable.
type | The AirportType to check. |
|
static |
Checks whether the given tile is actually a tile with an airport.
tile | The tile to check. |
|
static |
Checks whether the given tile is actually a tile with a hangar.
tile | The tile to check. |
|
static |
Checks whether the given AirportType is valid and available.
type | The AirportType to check. |
|
static |
Removes an airport.
tile | Any tile of the airport. |
AIError::ERR_OWNED_BY_ANOTHER_COMPANY |