summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorfonsinchen <fonsinchen@openttd.org>2014-09-21 16:20:14 +0000
committerfonsinchen <fonsinchen@openttd.org>2014-09-21 16:20:14 +0000
commit73d273ffd63d809234c6fa5744d13e520e3e480b (patch)
treeec3b95b87fe627a3120fb0479a67b3a661d9587d /bin
parent9fdb88962fed69472a88861cf08d9559e8dff2a4 (diff)
downloadopenttd-73d273ffd63d809234c6fa5744d13e520e3e480b.tar.xz
(svn r26892) -Feature: Script API for retrieving planned flow
Diffstat (limited to 'bin')
-rw-r--r--bin/ai/regression/regression.nut19
-rw-r--r--bin/ai/regression/regression.txt38
2 files changed, 57 insertions, 0 deletions
diff --git a/bin/ai/regression/regression.nut b/bin/ai/regression/regression.nut
index 72a0c5a97..d856c3307 100644
--- a/bin/ai/regression/regression.nut
+++ b/bin/ai/regression/regression.nut
@@ -1269,6 +1269,25 @@ function Regression::Station()
}
}
+ print("");
+ print("--CargoPlanned--");
+ for (local cargo = 0; cargo <= 1000; cargo += 1000) {
+ for (local station0 = 0; station0 <= 1000; station0 += 1000) {
+ print(" GetCargoPlanned(" + station0 + ", " + cargo + "): " +
+ AIStation.GetCargoPlanned(station0, cargo));
+ for (local station1 = 0; station1 <= 1000; station1 += 1000) {
+ print(" GetCargoPlannedFrom(" + station0 + ", " + station1 + ", " + cargo + "): " +
+ AIStation.GetCargoPlannedFrom(station0, station1, cargo));
+ print(" GetCargoPlannedVia(" + station0 + ", " + station1 + ", " + cargo + "): " +
+ AIStation.GetCargoPlannedFrom(station0, station1, cargo));
+ for (local station2 = 0; station2 <= 1000; station2 += 1000) {
+ print(" GetCargoPlannedFromVia(" + station0 + ", " + station1 + ", " + station2 + ", " + cargo + "): " +
+ AIStation.GetCargoPlannedFromVia(station0, station1, station2, cargo));
+ }
+ }
+ }
+ }
+
local list = AIStationList(AIStation.STATION_BUS_STOP + AIStation.STATION_TRUCK_STOP);
print("");
diff --git a/bin/ai/regression/regression.txt b/bin/ai/regression/regression.txt
index e6f30d220..5150c5c28 100644
--- a/bin/ai/regression/regression.txt
+++ b/bin/ai/regression/regression.txt
@@ -7539,6 +7539,44 @@ ERROR: IsEnd() is invalid as Begin() is never called
GetCargoWaitingFromVia(1000, 1000, 0, 1000): -1
GetCargoWaitingFromVia(1000, 1000, 1000, 1000): -1
+--CargoPlanned--
+ GetCargoPlanned(0, 0): 0
+ GetCargoPlannedFrom(0, 0, 0): 0
+ GetCargoPlannedVia(0, 0, 0): 0
+ GetCargoPlannedFromVia(0, 0, 0, 0): 0
+ GetCargoPlannedFromVia(0, 0, 1000, 0): -1
+ GetCargoPlannedFrom(0, 1000, 0): -1
+ GetCargoPlannedVia(0, 1000, 0): -1
+ GetCargoPlannedFromVia(0, 1000, 0, 0): -1
+ GetCargoPlannedFromVia(0, 1000, 1000, 0): -1
+ GetCargoPlanned(1000, 0): -1
+ GetCargoPlannedFrom(1000, 0, 0): -1
+ GetCargoPlannedVia(1000, 0, 0): -1
+ GetCargoPlannedFromVia(1000, 0, 0, 0): -1
+ GetCargoPlannedFromVia(1000, 0, 1000, 0): -1
+ GetCargoPlannedFrom(1000, 1000, 0): -1
+ GetCargoPlannedVia(1000, 1000, 0): -1
+ GetCargoPlannedFromVia(1000, 1000, 0, 0): -1
+ GetCargoPlannedFromVia(1000, 1000, 1000, 0): -1
+ GetCargoPlanned(0, 1000): -1
+ GetCargoPlannedFrom(0, 0, 1000): -1
+ GetCargoPlannedVia(0, 0, 1000): -1
+ GetCargoPlannedFromVia(0, 0, 0, 1000): -1
+ GetCargoPlannedFromVia(0, 0, 1000, 1000): -1
+ GetCargoPlannedFrom(0, 1000, 1000): -1
+ GetCargoPlannedVia(0, 1000, 1000): -1
+ GetCargoPlannedFromVia(0, 1000, 0, 1000): -1
+ GetCargoPlannedFromVia(0, 1000, 1000, 1000): -1
+ GetCargoPlanned(1000, 1000): -1
+ GetCargoPlannedFrom(1000, 0, 1000): -1
+ GetCargoPlannedVia(1000, 0, 1000): -1
+ GetCargoPlannedFromVia(1000, 0, 0, 1000): -1
+ GetCargoPlannedFromVia(1000, 0, 1000, 1000): -1
+ GetCargoPlannedFrom(1000, 1000, 1000): -1
+ GetCargoPlannedVia(1000, 1000, 1000): -1
+ GetCargoPlannedFromVia(1000, 1000, 0, 1000): -1
+ GetCargoPlannedFromVia(1000, 1000, 1000, 1000): -1
+
--StationList--
Count(): 2
Location ListDump: