diff options
author | michi_cc <michi_cc@openttd.org> | 2012-04-17 19:43:18 +0000 |
---|---|---|
committer | michi_cc <michi_cc@openttd.org> | 2012-04-17 19:43:18 +0000 |
commit | aa47d6c7f2b18d5277ed8d1e47f078e6d73bc6b9 (patch) | |
tree | c9dfb4e1826ddbef58cc31872029e49d18c9d9bd /src/script/api/script_station.hpp | |
parent | af6a33bd1c191f1fcb60f85d8c2c38eca6db4cc5 (diff) | |
download | openttd-aa47d6c7f2b18d5277ed8d1e47f078e6d73bc6b9.tar.xz |
(svn r24127) -Feature [FS#1497]: Allow closing airports for incoming aircraft. (Based on patch by cirdan)
Diffstat (limited to 'src/script/api/script_station.hpp')
-rw-r--r-- | src/script/api/script_station.hpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/script/api/script_station.hpp b/src/script/api/script_station.hpp index 268a0bce4..bb5d22c1b 100644 --- a/src/script/api/script_station.hpp +++ b/src/script/api/script_station.hpp @@ -172,6 +172,24 @@ public: * towns grow, towns change. So don't depend on this value too much. */ static TownID GetNearestTown(StationID station_id); + + /** + * Get the open/closed state of an airport. + * @param station_id The airport to look at. + * @pre IsValidStation(station_id). + * @pre HasStationType(station_id, STATION_AIRPORT). + * @return True if the airport is currently closed to incoming traffic. + */ + static bool IsAirportClosed(StationID station_id); + + /** + * Toggle the open/closed state of an airport. + * @param station_id The airport to modify. + * @pre IsValidStation(station_id). + * @pre HasStationType(station_id, STATION_AIRPORT). + * @return True if the state could be toggled. + */ + static bool OpenCloseAirport(StationID station_id); }; DECLARE_ENUM_AS_BIT_SET(ScriptStation::StationType) |