summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-01-04 19:42:29 +0000
committerfrosch <frosch@openttd.org>2010-01-04 19:42:29 +0000
commit1ed599f5cf6a0dec14d91d5442a08560e254d35c (patch)
tree969762c9812a05d4cc85ffc522779bbc7667496a /bin
parent27fc22a76bf470c2088a38d57d9cd2a8e481cafb (diff)
downloadopenttd-1ed599f5cf6a0dec14d91d5442a08560e254d35c.tar.xz
(svn r18725) -Add: [NoAI] AIWaypoint::WaypointType and AIWaypoint::HasWaypointType().
-Change: [NoAI] Constructor of AIWaypoint now takes a WaypointType to also handle buoys. -Remove: [NoAI] AIBuoyList.
Diffstat (limited to 'bin')
-rw-r--r--bin/ai/compat_0.7.nut8
-rw-r--r--bin/ai/regression/regression.nut10
-rw-r--r--bin/ai/regression/regression.txt4
3 files changed, 18 insertions, 4 deletions
diff --git a/bin/ai/compat_0.7.nut b/bin/ai/compat_0.7.nut
index a90c79314..3e4b4fa68 100644
--- a/bin/ai/compat_0.7.nut
+++ b/bin/ai/compat_0.7.nut
@@ -250,3 +250,11 @@ AIEngine.GetPlaneType <- function(engine_id)
if (!AIEngine.IsBuildable(engine_id)) return -1;
return AIEngine._GetPlaneType(engine_id);
}
+
+_AIWaypointList <- AIWaypointList;
+class AIWaypointList extends _AIWaypointList {
+ constructor()
+ {
+ ::_AIWaypointList.constructor(AIWaypoint.WAYPOINT_RAIL);
+ }
+}
diff --git a/bin/ai/regression/regression.nut b/bin/ai/regression/regression.nut
index b009ef0de..8af065abf 100644
--- a/bin/ai/regression/regression.nut
+++ b/bin/ai/regression/regression.nut
@@ -805,13 +805,17 @@ function Regression::Marine()
print(" IsCanalTile(): " + AIMarine.IsCanalTile(32127));
print(" GetBankBalance(): " + AICompany.GetBankBalance(AICompany.COMPANY_SELF));
- local list = AIBuoyList();
+ local list = AIWaypointList(AIWaypoint.WAYPOINT_BUOY);
print("");
- print("--AIBuoyList--");
+ print("--AIWaypointList(BUOY)--");
print(" Count(): " + list.Count());
print(" Location ListDump:");
for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
- print(" " + i);
+ print(" " + AIWaypoint.GetLocation(i));
+ }
+ print(" HasWaypointType:");
+ for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
+ print(" " + AIWaypoint.HasWaypointType(i, AIWaypoint.WAYPOINT_RAIL) + " " + AIWaypoint.HasWaypointType(i, AIWaypoint.WAYPOINT_BUOY) + " " + AIWaypoint.HasWaypointType(i, AIWaypoint.WAYPOINT_ANY));
}
print("");
diff --git a/bin/ai/regression/regression.txt b/bin/ai/regression/regression.txt
index 0adf36e1c..c5b65d863 100644
--- a/bin/ai/regression/regression.txt
+++ b/bin/ai/regression/regression.txt
@@ -7100,10 +7100,12 @@
IsCanalTile(): true
GetBankBalance(): 1999951154
---AIBuoyList--
+--AIWaypointList(BUOY)--
Count(): 1
Location ListDump:
28481
+ HasWaypointType:
+ false true false
RemoveWaterDepot(): true
RemoveDock(): true