summaryrefslogtreecommitdiff
path: root/bin/ai/regression
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2009-05-23 14:54:55 +0000
committeryexo <yexo@openttd.org>2009-05-23 14:54:55 +0000
commit0b243d25cbe8fec67a004cebee288ae741867cff (patch)
tree73b8b77851f4ed6ecaaf4de3c11b3a41cb0174e0 /bin/ai/regression
parent8e30f0e75abe83358a0d3c72716d7a77d0f89cf1 (diff)
downloadopenttd-0b243d25cbe8fec67a004cebee288ae741867cff.tar.xz
(svn r16400) -Add [NoAI]: add AISignList that can be used to get a list of valid signs. This makes AISign::GetMaxSignID obsolete.
Diffstat (limited to 'bin/ai/regression')
-rw-r--r--bin/ai/regression/regression.nut7
-rw-r--r--bin/ai/regression/regression.txt13
2 files changed, 4 insertions, 16 deletions
diff --git a/bin/ai/regression/regression.nut b/bin/ai/regression/regression.nut
index 82154c9db..7ec415639 100644
--- a/bin/ai/regression/regression.nut
+++ b/bin/ai/regression/regression.nut
@@ -1077,9 +1077,10 @@ function Regression::Sign()
print(" BuildSign(33409, 'Some other Sign'): " + sign_id);
print(" RemoveSign(" + sign_id + "): " + AISign.RemoveSign(sign_id));
print("");
- print(" GetMaxSignID(): " + AISign.GetMaxSignID());
- for (local i = -1; i < AISign.GetMaxSignID() + 1; i++) {
- if (AISign.IsValidSign(i)) j++;
+ local list = AISignList();
+ list.Sort(AIAbstractList.SORT_BY_ITEM, true);
+ for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
+ j++;
print(" Sign " + i);
print(" IsValidSign(): " + AISign.IsValidSign(i));
print(" GetName(): " + AISign.GetName(i));
diff --git a/bin/ai/regression/regression.txt b/bin/ai/regression/regression.txt
index d19c93605..c6745d056 100644
--- a/bin/ai/regression/regression.txt
+++ b/bin/ai/regression/regression.txt
@@ -7242,11 +7242,6 @@
BuildSign(33409, 'Some other Sign'): 2
RemoveSign(2): true
- GetMaxSignID(): 3
- Sign -1
- IsValidSign(): false
- GetName(): (null : 0x00000000)
- GetLocation(): -1
Sign 0
IsValidSign(): true
GetName(): Some Sign
@@ -7255,14 +7250,6 @@
IsValidSign(): true
GetName(): Test2
GetLocation(): 33411
- Sign 2
- IsValidSign(): false
- GetName(): (null : 0x00000000)
- GetLocation(): -1
- Sign 3
- IsValidSign(): false
- GetName(): (null : 0x00000000)
- GetLocation(): -1
Valid Signs: 2
--Station--