Add: [Script] GetAirportNumHelipads (#12085)
Adds a function for Scripts to get the number of helipads of an airport type.
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
* \li AITown::ROAD_LAYOUT_RANDOM
|
||||
* \li AIVehicle::IsPrimaryVehicle
|
||||
* \li AITileList_StationCoverage
|
||||
* \li AIAirport::GetAirportNumHelipads
|
||||
*
|
||||
* API removals:
|
||||
* \li AIError::ERR_PRECONDITION_TOO_MANY_PARAMETERS, that error is never returned anymore.
|
||||
|
@@ -88,6 +88,7 @@
|
||||
* \li GSStoryPage::IsValidStoryPageButtonFlags
|
||||
* \li GSStoryPage::IsValidStoryPageButtonCursor
|
||||
* \li GSTileList_StationCoverage
|
||||
* \li GSAirport::GetAirportNumHelipads
|
||||
*
|
||||
* API removals:
|
||||
* \li GSError::ERR_PRECONDITION_TOO_MANY_PARAMETERS, that error is never returned anymore.
|
||||
|
@@ -170,3 +170,10 @@
|
||||
|
||||
return (int64_t)GetMaintenanceCostFactor(type) * _price[PR_INFRASTRUCTURE_AIRPORT] >> 3;
|
||||
}
|
||||
|
||||
/* static */ SQInteger ScriptAirport::GetAirportNumHelipads(AirportType type)
|
||||
{
|
||||
if (!IsAirportInformationAvailable(type)) return -1;
|
||||
|
||||
return ::AirportSpec::Get(type)->fsm->num_helipads;
|
||||
}
|
||||
|
@@ -207,6 +207,14 @@ public:
|
||||
* @return Monthly maintenance cost of the airport type.
|
||||
*/
|
||||
static Money GetMonthlyMaintenanceCost(AirportType type);
|
||||
|
||||
/**
|
||||
* Get the number of helipads of this airport type.
|
||||
* @param type The airport type.
|
||||
* @pre IsAirportInformationAvailable(type)
|
||||
* @return Number of helipads of this type of airport. When 0 helicopters will go to normal terminals.
|
||||
*/
|
||||
static SQInteger GetAirportNumHelipads(AirportType type);
|
||||
};
|
||||
|
||||
#endif /* SCRIPT_AIRPORT_HPP */
|
||||
|
Reference in New Issue
Block a user