summaryrefslogtreecommitdiff
path: root/src/script/api/script_station.hpp
diff options
context:
space:
mode:
authorzuu <zuu@openttd.org>2014-03-10 22:18:53 +0000
committerzuu <zuu@openttd.org>2014-03-10 22:18:53 +0000
commitae23f519f708d6f963a1223021455440e13fe9aa (patch)
tree6a17b511109b373a9b15061beaedbf83b6041d3e /src/script/api/script_station.hpp
parent51501be48f3d499fa8db0829ab6aaf19d5dfdc74 (diff)
downloadopenttd-ae23f519f708d6f963a1223021455440e13fe9aa.tar.xz
(svn r26396) -Add: [script] AI/GS APIs to get cargo waiting from/via other station
Diffstat (limited to 'src/script/api/script_station.hpp')
-rw-r--r--src/script/api/script_station.hpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/script/api/script_station.hpp b/src/script/api/script_station.hpp
index 7614b516c..8108b8370 100644
--- a/src/script/api/script_station.hpp
+++ b/src/script/api/script_station.hpp
@@ -87,6 +87,31 @@ public:
static int32 GetCargoWaiting(StationID station_id, CargoID cargo_id);
/**
+ * See how much cargo with a specific source station there is waiting on a station.
+ * @param station_id The station to get the cargo-waiting of.
+ * @param cargo_id The cargo to get the cargo-waiting of.
+ * @pre IsValidStation(station_id).
+ * @pre IsValidStation(from_station_id) || from_station_id == STATION_INVALID.
+ * @pre IsValidCargo(cargo_id).
+ * @return The amount of units waiting at the station originating from from_station_id.
+ * @note source station means, the station where cargo was first loaded.
+ */
+ static int32 GetCargoWaitingFrom(StationID station_id, StationID from_station_id, CargoID cargo_id);
+
+ /**
+ * See how much cargo with a specific via-station there is waiting on a station.
+ * @param station_id The station to get the cargo-waiting of, or pass STATION_INVALID to get waiting cargo for "via any station".
+ * @param cargo_id The cargo to get the cargo-waiting of.
+ * @pre IsValidStation(station_id).
+ * @pre IsValidStation(via_station_id) || via_station_id == STATION_INVALID.
+ * @pre IsValidCargo(cargo_id).
+ * @return The amount of units waiting at the station with via_station_id as next hop.
+ * @note if ScriptCargo.GetCargoDistributionType(cargo_id) == ScriptCargo.DT_MANUAL, then all waiting cargo will have STATION_INVALID as next hop.
+
+ */
+ static int32 GetCargoWaitingVia(StationID station_id, StationID via_station_id, CargoID cargo_id);
+
+ /**
* Check whether the given cargo at the given station a rating.
* @param station_id The station to get the cargo-rating state of.
* @param cargo_id The cargo to get the cargo-rating state of.