mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-19 12:39:11 +00:00
(svn r17005) -Add [NoAI]: AIAbstractList::SORT_ASCENDING / SORT_DESCENDING
This commit is contained in:
@@ -58,7 +58,7 @@ function Regression::TestInit()
|
||||
}
|
||||
|
||||
list = AIList();
|
||||
list.Sort(AIAbstractList.SORT_BY_VALUE, true);
|
||||
list.Sort(AIAbstractList.SORT_BY_VALUE, AIAbstractList.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, false);
|
||||
list.Sort(AIAbstractList.SORT_BY_ITEM, AIAbstractList.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, true);
|
||||
list.Sort(AIAbstractList.SORT_BY_ITEM, AIAbstractList.SORT_ASCENDING);
|
||||
print("");
|
||||
print(" Item Ascending");
|
||||
list.AddItem( 5, 10);
|
||||
@@ -545,7 +545,7 @@ function Regression::Industry()
|
||||
print("--Industry--");
|
||||
print(" GetIndustryCount(): " + AIIndustry.GetIndustryCount());
|
||||
local list = AIIndustryList();
|
||||
list.Sort(AIAbstractList.SORT_BY_ITEM, true);
|
||||
list.Sort(AIAbstractList.SORT_BY_ITEM, AIAbstractList.SORT_ASCENDING);
|
||||
for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
|
||||
if (AIIndustry.IsValidIndustry(i)) j++;
|
||||
print(" Industry " + i);
|
||||
@@ -667,7 +667,7 @@ function Regression::List()
|
||||
print(" HasItem(1050): " + list.HasItem(1050));
|
||||
print(" HasItem(1051): " + list.HasItem(1051));
|
||||
print(" IsEmpty(): " + list.IsEmpty());
|
||||
list.Sort(AIAbstractList.SORT_BY_ITEM, true);
|
||||
list.Sort(AIAbstractList.SORT_BY_ITEM, AIAbstractList.SORT_ASCENDING);
|
||||
print(" List Dump:");
|
||||
for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
|
||||
print(" " + i + " => " + list.GetValue(i));
|
||||
@@ -1088,7 +1088,7 @@ function Regression::Sign()
|
||||
print(" RemoveSign(" + sign_id + "): " + AISign.RemoveSign(sign_id));
|
||||
print("");
|
||||
local list = AISignList();
|
||||
list.Sort(AIAbstractList.SORT_BY_ITEM, true);
|
||||
list.Sort(AIAbstractList.SORT_BY_ITEM, AIAbstractList.SORT_ASCENDING);
|
||||
for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
|
||||
j++;
|
||||
print(" Sign " + i);
|
||||
@@ -1357,7 +1357,7 @@ function Regression::Town()
|
||||
print("--Town--");
|
||||
print(" GetTownCount(): " + AITown.GetTownCount());
|
||||
local list = AITownList();
|
||||
list.Sort(AIAbstractList.SORT_BY_ITEM, true);
|
||||
list.Sort(AIAbstractList.SORT_BY_ITEM, AIAbstractList.SORT_ASCENDING);
|
||||
for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
|
||||
if (AITown.IsValidTown(i)) j++;
|
||||
print(" Town " + i);
|
||||
|
Reference in New Issue
Block a user