summaryrefslogtreecommitdiff
path: root/bin/ai
diff options
context:
space:
mode:
Diffstat (limited to 'bin/ai')
-rw-r--r--bin/ai/compat_0.7.nut3
-rw-r--r--bin/ai/compat_1.0.nut3
-rw-r--r--bin/ai/regression/regression.nut16
3 files changed, 12 insertions, 10 deletions
diff --git a/bin/ai/compat_0.7.nut b/bin/ai/compat_0.7.nut
index 0cb9857e6..1c73183c5 100644
--- a/bin/ai/compat_0.7.nut
+++ b/bin/ai/compat_0.7.nut
@@ -275,7 +275,6 @@ AIRoad.BuildDriveThroughRoadStation <- function(tile, front, road_veh_type, stat
return AIRoad._BuildDriveThroughRoadStation(tile, front, road_veh_type, station_id);
}
-AIAbstractList.HasNext <-
AIBridgeList.HasNext <-
AIBridgeList_Length.HasNext <-
AICargoList.HasNext <-
@@ -316,3 +315,5 @@ AIIndustry.IsCargoAccepted <- function(industry_id, cargo_id)
{
return AIIndustry._IsCargoAccepted(industry_id, cargo_id) != AIIndustry.CAS_NOT_ACCEPTED;
}
+
+AIAbstractList <- AIList;
diff --git a/bin/ai/compat_1.0.nut b/bin/ai/compat_1.0.nut
index 267b85871..5cda3ad74 100644
--- a/bin/ai/compat_1.0.nut
+++ b/bin/ai/compat_1.0.nut
@@ -25,7 +25,6 @@ AIRoad.BuildDriveThroughRoadStation <- function(tile, front, road_veh_type, stat
return AIRoad._BuildDriveThroughRoadStation(tile, front, road_veh_type, station_id);
}
-AIAbstractList.HasNext <-
AIBridgeList.HasNext <-
AIBridgeList_Length.HasNext <-
AICargoList.HasNext <-
@@ -67,3 +66,5 @@ AIIndustry.IsCargoAccepted <- function(industry_id, cargo_id)
{
return AIIndustry._IsCargoAccepted(industry_id, cargo_id) != AIIndustry.CAS_NOT_ACCEPTED;
}
+
+AIAbstractList <- AIList;
diff --git a/bin/ai/regression/regression.nut b/bin/ai/regression/regression.nut
index 2d3db61a5..f2e0fe6eb 100644
--- a/bin/ai/regression/regression.nut
+++ b/bin/ai/regression/regression.nut
@@ -58,7 +58,7 @@ function Regression::TestInit()
}
list = AIList();
- list.Sort(AIAbstractList.SORT_BY_VALUE, AIAbstractList.SORT_ASCENDING);
+ list.Sort(AIList.SORT_BY_VALUE, AIList.SORT_ASCENDING);
print("");
print(" Value Ascending");
list.AddItem( 5, 10);
@@ -93,7 +93,7 @@ function Regression::TestInit()
}
list = AIList();
- list.Sort(AIAbstractList.SORT_BY_ITEM, AIAbstractList.SORT_DESCENDING);
+ list.Sort(AIList.SORT_BY_ITEM, AIList.SORT_DESCENDING);
print("");
print(" Item Descending");
list.AddItem( 5, 10);
@@ -128,7 +128,7 @@ function Regression::TestInit()
}
list = AIList();
- list.Sort(AIAbstractList.SORT_BY_ITEM, AIAbstractList.SORT_ASCENDING);
+ list.Sort(AIList.SORT_BY_ITEM, AIList.SORT_ASCENDING);
print("");
print(" Item Ascending");
list.AddItem( 5, 10);
@@ -585,7 +585,7 @@ function Regression::Industry()
print("--Industry--");
print(" GetIndustryCount(): " + AIIndustry.GetIndustryCount());
local list = AIIndustryList();
- list.Sort(AIAbstractList.SORT_BY_ITEM, AIAbstractList.SORT_ASCENDING);
+ list.Sort(AIList.SORT_BY_ITEM, AIList.SORT_ASCENDING);
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
if (AIIndustry.IsValidIndustry(i)) j++;
print(" Industry " + i);
@@ -704,12 +704,12 @@ function Regression::List()
}
list.RemoveItem(1050);
list.RemoveItem(1150);
- list.ChangeItem(1051, 12);
+ list.SetValue(1051, 12);
print(" Count(): " + list.Count());
print(" HasItem(1050): " + list.HasItem(1050));
print(" HasItem(1051): " + list.HasItem(1051));
print(" IsEmpty(): " + list.IsEmpty());
- list.Sort(AIAbstractList.SORT_BY_ITEM, AIAbstractList.SORT_ASCENDING);
+ list.Sort(AIList.SORT_BY_ITEM, AIList.SORT_ASCENDING);
print(" List Dump:");
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
print(" " + i + " => " + list.GetValue(i));
@@ -1198,7 +1198,7 @@ function Regression::Sign()
print(" RemoveSign(" + sign_id + "): " + AISign.RemoveSign(sign_id));
print("");
local list = AISignList();
- list.Sort(AIAbstractList.SORT_BY_ITEM, AIAbstractList.SORT_ASCENDING);
+ list.Sort(AIList.SORT_BY_ITEM, AIList.SORT_ASCENDING);
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
j++;
print(" Sign " + i);
@@ -1467,7 +1467,7 @@ function Regression::Town()
print("--Town--");
print(" GetTownCount(): " + AITown.GetTownCount());
local list = AITownList();
- list.Sort(AIAbstractList.SORT_BY_ITEM, AIAbstractList.SORT_ASCENDING);
+ list.Sort(AIList.SORT_BY_ITEM, AIList.SORT_ASCENDING);
for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
if (AITown.IsValidTown(i)) j++;
print(" Town " + i);