summaryrefslogtreecommitdiff
path: root/bin/ai/regression/tst_stationlist/main.nut
diff options
context:
space:
mode:
Diffstat (limited to 'bin/ai/regression/tst_stationlist/main.nut')
-rw-r--r--bin/ai/regression/tst_stationlist/main.nut80
1 files changed, 80 insertions, 0 deletions
diff --git a/bin/ai/regression/tst_stationlist/main.nut b/bin/ai/regression/tst_stationlist/main.nut
new file mode 100644
index 000000000..d8ea72a67
--- /dev/null
+++ b/bin/ai/regression/tst_stationlist/main.nut
@@ -0,0 +1,80 @@
+/* $Id$ */
+
+class Regression extends AIController {
+ function Start();
+};
+
+
+function Regression::StationList()
+{
+ local list = AIStationList(AIStation.STATION_BUS_STOP + AIStation.STATION_TRUCK_STOP);
+
+ print("");
+ print("--StationList--");
+ print(" Count(): " + list.Count());
+ list.Valuate(AIStation.GetLocation);
+ print(" Location ListDump:");
+ for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
+ print(" " + i + " => " + list.GetValue(i));
+ }
+ list.Valuate(AIStation.GetCargoWaiting, 0);
+ print(" CargoWaiting(0) ListDump:");
+ for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
+ print(" " + i + " => " + list.GetValue(i));
+ }
+ list.Valuate(AIStation.GetCargoWaiting, 1);
+ print(" CargoWaiting(1) ListDump:");
+ for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
+ print(" " + i + " => " + list.GetValue(i));
+ }
+};
+
+function Regression::StationList_Vehicle()
+{
+ local list = AIStationList_Vehicle(12);
+
+ print("");
+ print("--StationList_Vehicle--");
+ print(" Count(): " + list.Count());
+ list.Valuate(AIStation.GetLocation);
+ print(" Location ListDump:");
+ for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
+ print(" " + i + " => " + list.GetValue(i));
+ }
+ list.Valuate(AIStation.GetCargoWaiting, 0);
+ print(" CargoWaiting(0) ListDump:");
+ for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
+ print(" " + i + " => " + list.GetValue(i));
+ }
+ list.Valuate(AIStation.GetCargoWaiting, 1);
+ print(" CargoWaiting(1) ListDump:");
+ for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
+ print(" " + i + " => " + list.GetValue(i));
+ }
+ list.Valuate(AIStation.GetCargoRating, 1);
+ print(" CargoRating(1) ListDump:");
+ for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
+ print(" " + i + " => " + list.GetValue(i));
+ }
+ list.Valuate(AIStation.GetDistanceManhattanToTile, 30000);
+ print(" DistanceManhattanToTile(30000) ListDump:");
+ for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
+ print(" " + i + " => " + list.GetValue(i));
+ }
+ list.Valuate(AIStation.GetDistanceSquareToTile, 30000);
+ print(" DistanceSquareToTile(30000) ListDump:");
+ for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
+ print(" " + i + " => " + list.GetValue(i));
+ }
+ list.Valuate(AIStation.IsWithinTownInfluence, 0);
+ print(" IsWithinTownInfluence(0) ListDump:");
+ for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
+ print(" " + i + " => " + list.GetValue(i));
+ }
+}
+
+function Regression::Start()
+{
+ StationList();
+ StationList_Vehicle();
+}