bin/ai/regression/regression.nut
author glx
Mon, 21 Apr 2008 20:33:03 +0000
branchnoai
changeset 10291 11cb78922367
parent 10193 9f73edc0c57a
child 10344 b7e9f5c65e30
permissions -rw-r--r--
(svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
9460
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
     1
class Regression extends AIController {
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
     2
	stop     = false;
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
     3
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
     4
	function Start();
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
     5
	function Stop();
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
     6
}
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
     7
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
     8
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
     9
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
    10
function Regression::TestInit()
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
    11
{
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
    12
	print("");
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
    13
	print("--TestInit--");
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
    14
	print(" TickTest: " + this.GetTick());
9557
a3e1a25cf3d3 (svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents: 9555
diff changeset
    15
	this.Sleep(1);
9460
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
    16
	print(" TickTest: " + this.GetTick());
9749
ee414c031e73 (svn r12229) [NoAI] -Fix: AISetting()s functions can be static too
truebrain
parents: 9745
diff changeset
    17
	print(" SetCommandDelay: " + AISettings.SetCommandDelay(1));
9460
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
    18
}
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
    19
9487
0575126e0267 (svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents: 9485
diff changeset
    20
function Regression::Std()
0575126e0267 (svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents: 9485
diff changeset
    21
{
0575126e0267 (svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents: 9485
diff changeset
    22
	print("");
0575126e0267 (svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents: 9485
diff changeset
    23
	print("--Std--");
0575126e0267 (svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents: 9485
diff changeset
    24
	print(" abs(-21): " + abs(-21));
0575126e0267 (svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents: 9485
diff changeset
    25
	print(" abs( 21): " + abs(21));
0575126e0267 (svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents: 9485
diff changeset
    26
}
0575126e0267 (svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents: 9485
diff changeset
    27
9460
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
    28
function Regression::Base()
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
    29
{
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
    30
	print("");
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
    31
	print("--AIBase--");
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
    32
	print("  Rand():       " + AIBase.Rand());
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
    33
	print("  Rand():       " + AIBase.Rand());
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
    34
	print("  Rand():       " + AIBase.Rand());
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
    35
	print("  RandRange(0): " + AIBase.RandRange(0));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
    36
	print("  RandRange(0): " + AIBase.RandRange(0));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
    37
	print("  RandRange(0): " + AIBase.RandRange(0));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
    38
	print("  RandRange(1): " + AIBase.RandRange(1));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
    39
	print("  RandRange(1): " + AIBase.RandRange(1));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
    40
	print("  RandRange(1): " + AIBase.RandRange(1));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
    41
	print("  RandRange(2): " + AIBase.RandRange(2));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
    42
	print("  RandRange(2): " + AIBase.RandRange(2));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
    43
	print("  RandRange(2): " + AIBase.RandRange(2));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
    44
	print("  RandRange(9): " + AIBase.RandRange(9));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
    45
	print("  RandRange(9): " + AIBase.RandRange(9));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
    46
	print("  RandRange(9): " + AIBase.RandRange(9));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
    47
	print("  Chance(1, 2): " + AIBase.Chance(1, 2));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
    48
	print("  Chance(1, 2): " + AIBase.Chance(1, 2));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
    49
	print("  Chance(1, 2): " + AIBase.Chance(1, 2));
9460
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
    50
}
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
    51
9654
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9652
diff changeset
    52
function Regression::Airport()
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9652
diff changeset
    53
{
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9652
diff changeset
    54
	print("");
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9652
diff changeset
    55
	print("--AIAirport--");
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9652
diff changeset
    56
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
    57
	print("  IsHangarTile():       " + AIAirport.IsHangarTile(32116));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
    58
	print("  IsAirportTile():      " + AIAirport.IsAirportTile(32116));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
    59
	print("  GetHangarOfAirport(): " + AIAirport.GetHangarOfAirport(32116));
9654
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9652
diff changeset
    60
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9652
diff changeset
    61
	for (local i = -1; i < 10; i++) {
9773
d2c20cd38f18 (svn r12266) [NoAI] -Fix: [API CHANGE] minor typo in Ai*r*portAvailable (tnx yorick)
truebrain
parents: 9771
diff changeset
    62
		print("  AirportAvailable(" + i + "):         " + AIAirport.AirportAvailable(i));
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
    63
		print("  GetAirportWidth(" + i + "):          " + AIAirport.GetAirportWidth(i));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
    64
		print("  GetAirportHeight(" + i + "):         " + AIAirport.GetAirportHeight(i));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
    65
		print("  GetAirportCoverageRadius(" + i + "): " + AIAirport.GetAirportCoverageRadius(i));
9654
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9652
diff changeset
    66
	}
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9652
diff changeset
    67
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
    68
	print("  GetBankBalance():     " + AICompany.GetBankBalance(AICompany.MY_COMPANY));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
    69
	print("  BuildAirport():       " + AIAirport.BuildAirport(32116, 0));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
    70
	print("  IsHangarTile():       " + AIAirport.IsHangarTile(32116));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
    71
	print("  IsAirportTile():      " + AIAirport.IsAirportTile(32116));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
    72
	print("  GetHangarOfAirport(): " + AIAirport.GetHangarOfAirport(32116));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
    73
	print("  IsHangarTile():       " + AIAirport.IsHangarTile(32119));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
    74
	print("  IsAirportTile():      " + AIAirport.IsAirportTile(32119));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
    75
	print("  GetBankBalance():     " + AICompany.GetBankBalance(AICompany.MY_COMPANY));
9654
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9652
diff changeset
    76
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
    77
	print("  RemoveAirport():      " + AIAirport.RemoveAirport(32118));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
    78
	print("  IsHangarTile():       " + AIAirport.IsHangarTile(32119));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
    79
	print("  IsAirportTile():      " + AIAirport.IsAirportTile(32119));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
    80
	print("  GetBankBalance():     " + AICompany.GetBankBalance(AICompany.MY_COMPANY));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
    81
	print("  BuildAirport():       " + AIAirport.BuildAirport(32116, 0));
9654
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9652
diff changeset
    82
}
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9652
diff changeset
    83
9792
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
    84
function Regression::Bridge()
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
    85
{
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
    86
	local j = 0;
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
    87
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
    88
	print("");
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
    89
	print("--Bridge--");
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
    90
	for (local i = -1; i < 14; i++) {
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
    91
		if (AIBridge.IsValidBridge(i)) j++;
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
    92
		print("  Bridge " + i);
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
    93
		print("    IsValidBridge():    " + AIBridge.IsValidBridge(i));
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
    94
		print("    GetName():          " + AIBridge.GetName(i));
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
    95
		print("    GetMaxSpeed():      " + AIBridge.GetMaxSpeed(i));
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
    96
		print("    GetPrice():         " + AIBridge.GetPrice(i, 5));
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
    97
		print("    GetMaxLength():     " + AIBridge.GetMaxLength(i));
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
    98
		print("    GetMinLength():     " + AIBridge.GetMinLength(i));
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
    99
		print("    GetYearAvailable(): " + AIBridge.GetYearAvailable(i));
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   100
	}
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   101
	print("  Valid Bridges:        " + j);
9793
c5fb53240401 (svn r12297) [NoAI] -Add: added AIBridge.BuildBridge and friends
truebrain
parents: 9792
diff changeset
   102
c5fb53240401 (svn r12297) [NoAI] -Add: added AIBridge.BuildBridge and friends
truebrain
parents: 9792
diff changeset
   103
	print("  IsBridgeTile():       " + AIBridge.IsBridgeTile(33160));
c5fb53240401 (svn r12297) [NoAI] -Add: added AIBridge.BuildBridge and friends
truebrain
parents: 9792
diff changeset
   104
	print("  RemoveBridge():       " + AIBridge.RemoveBridge(33155));
9867
b7d9ffe24f81 (svn r12589) [NoAI] -Add: GetLastError support for AIBridge.
rubidium
parents: 9865
diff changeset
   105
	print("  GetLastErrorString(): " + AIError.GetLastErrorString());
9793
c5fb53240401 (svn r12297) [NoAI] -Add: added AIBridge.BuildBridge and friends
truebrain
parents: 9792
diff changeset
   106
	print("  BuildBridge():        " + AIBridge.BuildBridge(AIVehicle.VEHICLE_ROAD, 5, 33160, 33155));
c5fb53240401 (svn r12297) [NoAI] -Add: added AIBridge.BuildBridge and friends
truebrain
parents: 9792
diff changeset
   107
	print("  IsBridgeTile():       " + AIBridge.IsBridgeTile(33160));
c5fb53240401 (svn r12297) [NoAI] -Add: added AIBridge.BuildBridge and friends
truebrain
parents: 9792
diff changeset
   108
	print("  IsBridgeTile():       " + AIBridge.IsBridgeTile(33155));
9867
b7d9ffe24f81 (svn r12589) [NoAI] -Add: GetLastError support for AIBridge.
rubidium
parents: 9865
diff changeset
   109
	print("  BuildBridge():        " + AIBridge.BuildBridge(AIVehicle.VEHICLE_ROAD, 5, 33160, 33155));
b7d9ffe24f81 (svn r12589) [NoAI] -Add: GetLastError support for AIBridge.
rubidium
parents: 9865
diff changeset
   110
	print("  GetLastErrorString(): " + AIError.GetLastErrorString());
9793
c5fb53240401 (svn r12297) [NoAI] -Add: added AIBridge.BuildBridge and friends
truebrain
parents: 9792
diff changeset
   111
	print("  RemoveBridge():       " + AIBridge.RemoveBridge(33155));
c5fb53240401 (svn r12297) [NoAI] -Add: added AIBridge.BuildBridge and friends
truebrain
parents: 9792
diff changeset
   112
	print("  IsBridgeTile():       " + AIBridge.IsBridgeTile(33160));
9792
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   113
}
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   114
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   115
function Regression::BridgeList()
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   116
{
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   117
	local list = AIBridgeList();
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   118
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   119
	print("");
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   120
	print("--BridgeList--");
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   121
	print("  Count():             " + list.Count());
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   122
	list.Valuate(AIBridge.GetMaxSpeed);
9792
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   123
	print("  MaxSpeed ListDump:");
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   124
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   125
		print("    " + i + " => " + list.GetValue(i));
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   126
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   127
	list.Valuate(AIBridge.GetPrice, 5);
9792
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   128
	print("  Price ListDump:");
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   129
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   130
		print("    " + i + " => " + list.GetValue(i));
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   131
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   132
	list.Valuate(AIBridge.GetMaxLength);
9792
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   133
	print("  MaxLength ListDump:");
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   134
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   135
		print("    " + i + " => " + list.GetValue(i));
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   136
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   137
	list.Valuate(AIBridge.GetMinLength);
9792
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   138
	print("  MinLength ListDump:");
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   139
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   140
		print("    " + i + " => " + list.GetValue(i));
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   141
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   142
	list.Valuate(AIBridge.GetYearAvailable);
9792
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   143
	print("  YearAvailable ListDump:");
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   144
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   145
		print("    " + i + " => " + list.GetValue(i));
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   146
	}
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   147
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   148
	local list = AIBridgeList_Length(14);
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   149
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   150
	print("");
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   151
	print("--BridgeList_Length--");
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   152
	print("  Count():             " + list.Count());
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   153
	list.Valuate(AIBridge.GetMaxSpeed);
9792
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   154
	print("  MaxSpeed ListDump:");
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   155
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   156
		print("    " + i + " => " + list.GetValue(i));
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   157
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   158
	list.Valuate(AIBridge.GetPrice, 14);
9792
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   159
	print("  Price ListDump:");
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   160
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   161
		print("    " + i + " => " + list.GetValue(i));
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   162
	}
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   163
}
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   164
9460
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
   165
function Regression::Cargo()
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
   166
{
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
   167
	print("");
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
   168
	print("--AICargo--");
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
   169
	for (local i = -1; i < 15; i++) {
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
   170
		print("  Cargo " + i);
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   171
		print("    IsValidCargo():          " + AICargo.IsValidCargo(i));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   172
		print("    GetCargoLabel():         '" + AICargo.GetCargoLabel(i)+ "'");
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   173
		print("    IsFreight():             " + AICargo.IsFreight(i));
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   174
		print("    GetCargoIncome(0, 0):    " + AICargo.GetCargoIncome(i, 0, 0));
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   175
		print("    GetCargoIncome(10, 10):  " + AICargo.GetCargoIncome(i, 10, 10));
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   176
		print("    GetCargoIncome(100, 10): " + AICargo.GetCargoIncome(i, 100, 10));
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   177
		print("    GetCargoIncome(10, 100): " + AICargo.GetCargoIncome(i, 10, 100));
9460
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
   178
	}
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
   179
}
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
   180
9785
edbd185e05ed (svn r12280) [NoAI] -Add: added AICargoList (Morloth)
truebrain
parents: 9776
diff changeset
   181
function Regression::CargoList()
edbd185e05ed (svn r12280) [NoAI] -Add: added AICargoList (Morloth)
truebrain
parents: 9776
diff changeset
   182
{
edbd185e05ed (svn r12280) [NoAI] -Add: added AICargoList (Morloth)
truebrain
parents: 9776
diff changeset
   183
	local list = AICargoList();
edbd185e05ed (svn r12280) [NoAI] -Add: added AICargoList (Morloth)
truebrain
parents: 9776
diff changeset
   184
edbd185e05ed (svn r12280) [NoAI] -Add: added AICargoList (Morloth)
truebrain
parents: 9776
diff changeset
   185
	print("");
edbd185e05ed (svn r12280) [NoAI] -Add: added AICargoList (Morloth)
truebrain
parents: 9776
diff changeset
   186
	print("--CargoList--");
edbd185e05ed (svn r12280) [NoAI] -Add: added AICargoList (Morloth)
truebrain
parents: 9776
diff changeset
   187
	print("  Count():            " + list.Count());
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   188
	list.Valuate(AICargo.IsFreight);
9788
e9dbd4ec1784 (svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents: 9785
diff changeset
   189
	print("  IsFreight ListDump:");
9785
edbd185e05ed (svn r12280) [NoAI] -Add: added AICargoList (Morloth)
truebrain
parents: 9776
diff changeset
   190
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
9788
e9dbd4ec1784 (svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents: 9785
diff changeset
   191
		print("    " + i + " => " + list.GetValue(i));
e9dbd4ec1784 (svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents: 9785
diff changeset
   192
	}
e9dbd4ec1784 (svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents: 9785
diff changeset
   193
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   194
	list.Valuate(AICargo.GetCargoIncome, 100, 100);
9788
e9dbd4ec1784 (svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents: 9785
diff changeset
   195
	print("  CargoIncomes(100, 100) ListDump:");
e9dbd4ec1784 (svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents: 9785
diff changeset
   196
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
e9dbd4ec1784 (svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents: 9785
diff changeset
   197
		print("    " + i + " => " + list.GetValue(i));
9785
edbd185e05ed (svn r12280) [NoAI] -Add: added AICargoList (Morloth)
truebrain
parents: 9776
diff changeset
   198
	}
edbd185e05ed (svn r12280) [NoAI] -Add: added AICargoList (Morloth)
truebrain
parents: 9776
diff changeset
   199
}
edbd185e05ed (svn r12280) [NoAI] -Add: added AICargoList (Morloth)
truebrain
parents: 9776
diff changeset
   200
9460
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
   201
function Regression::Company()
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
   202
{
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
   203
	print("");
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
   204
	print("--Company--");
9558
4fc9b464a932 (svn r9496) [NoAI] -Add: added regression for AITestMode() and AIExecMode()
truelight
parents: 9557
diff changeset
   205
4fc9b464a932 (svn r9496) [NoAI] -Add: added regression for AITestMode() and AIExecMode()
truelight
parents: 9557
diff changeset
   206
	/* Test AIXXXMode() in scopes */
4fc9b464a932 (svn r9496) [NoAI] -Add: added regression for AITestMode() and AIExecMode()
truelight
parents: 9557
diff changeset
   207
	{
4fc9b464a932 (svn r9496) [NoAI] -Add: added regression for AITestMode() and AIExecMode()
truelight
parents: 9557
diff changeset
   208
		local test = AITestMode();
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   209
		print("  SetCompanyName():     " + AICompany.SetCompanyName("Regression"));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   210
		print("  SetCompanyName():     " + AICompany.SetCompanyName("Regression"));
9558
4fc9b464a932 (svn r9496) [NoAI] -Add: added regression for AITestMode() and AIExecMode()
truelight
parents: 9557
diff changeset
   211
		{
4fc9b464a932 (svn r9496) [NoAI] -Add: added regression for AITestMode() and AIExecMode()
truelight
parents: 9557
diff changeset
   212
			local exec = AIExecMode();
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   213
			print("  SetCompanyName():     " + AICompany.SetCompanyName("Regression"));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   214
			print("  SetCompanyName():     " + AICompany.SetCompanyName("Regression"));
9865
f241472f09dc (svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents: 9844
diff changeset
   215
			print("  GetLastErrorString(): " + AIError.GetLastErrorString());
9558
4fc9b464a932 (svn r9496) [NoAI] -Add: added regression for AITestMode() and AIExecMode()
truelight
parents: 9557
diff changeset
   216
		}
4fc9b464a932 (svn r9496) [NoAI] -Add: added regression for AITestMode() and AIExecMode()
truelight
parents: 9557
diff changeset
   217
	}
4fc9b464a932 (svn r9496) [NoAI] -Add: added regression for AITestMode() and AIExecMode()
truelight
parents: 9557
diff changeset
   218
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   219
	print("  GetCompanyName():            " + AICompany.GetCompanyName(AICompany.MY_COMPANY));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   220
	print("  GetPresidentName():          " + AICompany.GetPresidentName(AICompany.MY_COMPANY));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   221
	print("  SetPresidentName():          " + AICompany.SetPresidentName("Regression AI"));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   222
	print("  GetPresidentName():          " + AICompany.GetPresidentName(AICompany.MY_COMPANY));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   223
	print("  GetCompanyValue():           " + AICompany.GetCompanyValue(AICompany.MY_COMPANY));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   224
	print("  GetBankBalance():            " + AICompany.GetBankBalance(AICompany.MY_COMPANY));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   225
	print("  GetCompanyName():            " + AICompany.GetCompanyName(240));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   226
	print("  GetLoanAmount():             " + AICompany.GetLoanAmount());
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   227
	print("  GetMaxLoanAmount():          " + AICompany.GetMaxLoanAmount());
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   228
	print("  GetLoanInterval():           " + AICompany.GetLoanInterval());
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   229
	print("  SetLoanAmount(1):            " + AICompany.SetLoanAmount(1));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   230
	print("  SetLoanAmount(100):          " + AICompany.SetLoanAmount(100));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   231
	print("  SetLoanAmount(10000):        " + AICompany.SetLoanAmount(10000));
9865
f241472f09dc (svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents: 9844
diff changeset
   232
	print("  GetLastErrorString():        " + AIError.GetLastErrorString());
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   233
	print("  GetBankBalance():            " + AICompany.GetBankBalance(AICompany.MY_COMPANY));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   234
	print("  GetLoanAmount():             " + AICompany.GetLoanAmount());
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   235
	print("  SetMinimumLoanAmount(31337): " + AICompany.SetMinimumLoanAmount(31337));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   236
	print("  GetBankBalance():            " + AICompany.GetBankBalance(AICompany.MY_COMPANY));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   237
	print("  GetLoanAmount():             " + AICompany.GetLoanAmount());
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   238
	print("  SetLoanAmount(10000):        " + AICompany.SetLoanAmount(AICompany.GetMaxLoanAmount()));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   239
	print("  GetBankBalance():            " + AICompany.GetBankBalance(AICompany.MY_COMPANY));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   240
	print("  GetLoanAmount():             " + AICompany.GetLoanAmount());
9808
0b40f556e051 (svn r12318) [NoAI] -Add: added AICompany::(Build|Get)CompanyHQ (college of Morloth)
truebrain
parents: 9807
diff changeset
   241
	print("  GetCompanyHQ():              " + AICompany.GetCompanyHQ(AICompany.MY_COMPANY));
0b40f556e051 (svn r12318) [NoAI] -Add: added AICompany::(Build|Get)CompanyHQ (college of Morloth)
truebrain
parents: 9807
diff changeset
   242
	print("  BuildCompanyHQ():            " + AICompany.BuildCompanyHQ(AIMap.GetTileIndex(127, 129)));
0b40f556e051 (svn r12318) [NoAI] -Add: added AICompany::(Build|Get)CompanyHQ (college of Morloth)
truebrain
parents: 9807
diff changeset
   243
	print("  GetCompanyHQ():              " + AICompany.GetCompanyHQ(AICompany.MY_COMPANY));
0b40f556e051 (svn r12318) [NoAI] -Add: added AICompany::(Build|Get)CompanyHQ (college of Morloth)
truebrain
parents: 9807
diff changeset
   244
	print("  BuildCompanyHQ():            " + AICompany.BuildCompanyHQ(AIMap.GetTileIndex(129, 129)));
0b40f556e051 (svn r12318) [NoAI] -Add: added AICompany::(Build|Get)CompanyHQ (college of Morloth)
truebrain
parents: 9807
diff changeset
   245
	print("  GetCompanyHQ():              " + AICompany.GetCompanyHQ(AICompany.MY_COMPANY));
9865
f241472f09dc (svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents: 9844
diff changeset
   246
	print("  BuildCompanyHQ():            " + AICompany.BuildCompanyHQ(AIMap.GetTileIndex(129, 128)));
f241472f09dc (svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents: 9844
diff changeset
   247
	print("  GetLastErrorString():        " + AIError.GetLastErrorString());
10291
11cb78922367 (svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents: 10193
diff changeset
   248
	print("  GetAutoRenewStatus();        " + AICompany.GetAutoRenewStatus(AICompany.MY_COMPANY));
11cb78922367 (svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents: 10193
diff changeset
   249
	print("  SetAutoRenewStatus(true);    " + AICompany.SetAutoRenewStatus(true));
11cb78922367 (svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents: 10193
diff changeset
   250
	print("  GetAutoRenewStatus();        " + AICompany.GetAutoRenewStatus(AICompany.MY_COMPANY));
11cb78922367 (svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents: 10193
diff changeset
   251
	print("  SetAutoRenewStatus(true);    " + AICompany.SetAutoRenewStatus(true));
11cb78922367 (svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents: 10193
diff changeset
   252
	print("  SetAutoRenewStatus(false);   " + AICompany.SetAutoRenewStatus(false));
11cb78922367 (svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents: 10193
diff changeset
   253
	print("  GetAutoRenewMonths();        " + AICompany.GetAutoRenewMonths(AICompany.MY_COMPANY));
11cb78922367 (svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents: 10193
diff changeset
   254
	print("  SetAutoRenewMonths(-12);     " + AICompany.SetAutoRenewMonths(-12));
11cb78922367 (svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents: 10193
diff changeset
   255
	print("  GetAutoRenewMonths();        " + AICompany.GetAutoRenewMonths(AICompany.MY_COMPANY));
11cb78922367 (svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents: 10193
diff changeset
   256
	print("  SetAutoRenewMonths(-12);     " + AICompany.SetAutoRenewMonths(-12));
11cb78922367 (svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents: 10193
diff changeset
   257
	print("  SetAutoRenewMonths(6);       " + AICompany.SetAutoRenewMonths(6));
11cb78922367 (svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents: 10193
diff changeset
   258
	print("  GetAutoRenewMoney();         " + AICompany.GetAutoRenewMoney(AICompany.MY_COMPANY));
11cb78922367 (svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents: 10193
diff changeset
   259
	print("  SetAutoRenewMoney(200000);   " + AICompany.SetAutoRenewMoney(200000));
11cb78922367 (svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents: 10193
diff changeset
   260
	print("  GetAutoRenewMoney();         " + AICompany.GetAutoRenewMoney(AICompany.MY_COMPANY));
11cb78922367 (svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents: 10193
diff changeset
   261
	print("  SetAutoRenewMoney(200000);   " + AICompany.SetAutoRenewMoney(200000));
11cb78922367 (svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents: 10193
diff changeset
   262
	print("  SetAutoRenewMoney(100000);   " + AICompany.SetAutoRenewMoney(100000));
9460
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
   263
}
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
   264
9711
c8b427215c9d (svn r11295) [NoAI] -Change [API CHANGE]: put Engine things in AIEngine, and rename functions as such. Most noticable: FindBestXXXVehicle -> FineBestXXXEngine
truelight
parents: 9710
diff changeset
   265
function Regression::Engine()
c8b427215c9d (svn r11295) [NoAI] -Change [API CHANGE]: put Engine things in AIEngine, and rename functions as such. Most noticable: FindBestXXXVehicle -> FineBestXXXEngine
truelight
parents: 9710
diff changeset
   266
{
c8b427215c9d (svn r11295) [NoAI] -Change [API CHANGE]: put Engine things in AIEngine, and rename functions as such. Most noticable: FindBestXXXVehicle -> FineBestXXXEngine
truelight
parents: 9710
diff changeset
   267
	local j = 0;
c8b427215c9d (svn r11295) [NoAI] -Change [API CHANGE]: put Engine things in AIEngine, and rename functions as such. Most noticable: FindBestXXXVehicle -> FineBestXXXEngine
truelight
parents: 9710
diff changeset
   268
c8b427215c9d (svn r11295) [NoAI] -Change [API CHANGE]: put Engine things in AIEngine, and rename functions as such. Most noticable: FindBestXXXVehicle -> FineBestXXXEngine
truelight
parents: 9710
diff changeset
   269
	print("");
c8b427215c9d (svn r11295) [NoAI] -Change [API CHANGE]: put Engine things in AIEngine, and rename functions as such. Most noticable: FindBestXXXVehicle -> FineBestXXXEngine
truelight
parents: 9710
diff changeset
   270
	print("--Engine--");
c8b427215c9d (svn r11295) [NoAI] -Change [API CHANGE]: put Engine things in AIEngine, and rename functions as such. Most noticable: FindBestXXXVehicle -> FineBestXXXEngine
truelight
parents: 9710
diff changeset
   271
	for (local i = -1; i < 257; i++) {
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   272
		if (AIEngine.IsValidEngine(i)) j++;
9711
c8b427215c9d (svn r11295) [NoAI] -Change [API CHANGE]: put Engine things in AIEngine, and rename functions as such. Most noticable: FindBestXXXVehicle -> FineBestXXXEngine
truelight
parents: 9710
diff changeset
   273
		print("  Engine " + i);
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   274
		print("    IsValidEngine():    " + AIEngine.IsValidEngine(i));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   275
		print("    GetName():          " + AIEngine.GetName(i));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   276
		print("    GetCargoType():     " + AIEngine.GetCargoType(i));
9809
9b21c21052fa (svn r12325) [NoAI] -Add: added AIEngine:CanRefitCargo()
truebrain
parents: 9808
diff changeset
   277
		print("    CanRefitCargo():    " + AIEngine.CanRefitCargo(i, 1));
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   278
		print("    GetCapacity():      " + AIEngine.GetCapacity(i));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   279
		print("    GetReliability():   " + AIEngine.GetReliability(i));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   280
		print("    GetMaxSpeed():      " + AIEngine.GetMaxSpeed(i));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   281
		print("    GetPrice():         " + AIEngine.GetPrice(i));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   282
		print("    GetMaxAge():        " + AIEngine.GetMaxAge(i));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   283
		print("    GetRunningCost():   " + AIEngine.GetRunningCost(i));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   284
		print("    GetVehicleType():   " + AIEngine.GetVehicleType(i));
9711
c8b427215c9d (svn r11295) [NoAI] -Change [API CHANGE]: put Engine things in AIEngine, and rename functions as such. Most noticable: FindBestXXXVehicle -> FineBestXXXEngine
truelight
parents: 9710
diff changeset
   285
	}
c8b427215c9d (svn r11295) [NoAI] -Change [API CHANGE]: put Engine things in AIEngine, and rename functions as such. Most noticable: FindBestXXXVehicle -> FineBestXXXEngine
truelight
parents: 9710
diff changeset
   286
	print("  Valid Engines:        " + j);
c8b427215c9d (svn r11295) [NoAI] -Change [API CHANGE]: put Engine things in AIEngine, and rename functions as such. Most noticable: FindBestXXXVehicle -> FineBestXXXEngine
truelight
parents: 9710
diff changeset
   287
}
c8b427215c9d (svn r11295) [NoAI] -Change [API CHANGE]: put Engine things in AIEngine, and rename functions as such. Most noticable: FindBestXXXVehicle -> FineBestXXXEngine
truelight
parents: 9710
diff changeset
   288
9714
fdbdae7ea647 (svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents: 9713
diff changeset
   289
function Regression::EngineList()
fdbdae7ea647 (svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents: 9713
diff changeset
   290
{
fdbdae7ea647 (svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents: 9713
diff changeset
   291
	local list = AIEngineList(AIVehicle.VEHICLE_ROAD);
fdbdae7ea647 (svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents: 9713
diff changeset
   292
fdbdae7ea647 (svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents: 9713
diff changeset
   293
	print("");
fdbdae7ea647 (svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents: 9713
diff changeset
   294
	print("--EngineList--");
fdbdae7ea647 (svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents: 9713
diff changeset
   295
	print("  Count():             " + list.Count());
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   296
	list.Valuate(AIEngine.GetCargoType);
9714
fdbdae7ea647 (svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents: 9713
diff changeset
   297
	print("  CargoType ListDump:");
fdbdae7ea647 (svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents: 9713
diff changeset
   298
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
fdbdae7ea647 (svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents: 9713
diff changeset
   299
		print("    " + i + " => " + list.GetValue(i));
fdbdae7ea647 (svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents: 9713
diff changeset
   300
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   301
	list.Valuate(AIEngine.GetCapacity);
9714
fdbdae7ea647 (svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents: 9713
diff changeset
   302
	print("  Capacity ListDump:");
fdbdae7ea647 (svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents: 9713
diff changeset
   303
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
fdbdae7ea647 (svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents: 9713
diff changeset
   304
		print("    " + i + " => " + list.GetValue(i));
fdbdae7ea647 (svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents: 9713
diff changeset
   305
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   306
	list.Valuate(AIEngine.GetReliability);
9714
fdbdae7ea647 (svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents: 9713
diff changeset
   307
	print("  Reliability ListDump:");
fdbdae7ea647 (svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents: 9713
diff changeset
   308
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
fdbdae7ea647 (svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents: 9713
diff changeset
   309
		print("    " + i + " => " + list.GetValue(i));
fdbdae7ea647 (svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents: 9713
diff changeset
   310
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   311
	list.Valuate(AIEngine.GetMaxSpeed);
9714
fdbdae7ea647 (svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents: 9713
diff changeset
   312
	print("  MaxSpeed ListDump:");
fdbdae7ea647 (svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents: 9713
diff changeset
   313
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
fdbdae7ea647 (svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents: 9713
diff changeset
   314
		print("    " + i + " => " + list.GetValue(i));
fdbdae7ea647 (svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents: 9713
diff changeset
   315
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   316
	list.Valuate(AIEngine.GetPrice);
9714
fdbdae7ea647 (svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents: 9713
diff changeset
   317
	print("  Price ListDump:");
fdbdae7ea647 (svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents: 9713
diff changeset
   318
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
fdbdae7ea647 (svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents: 9713
diff changeset
   319
		print("    " + i + " => " + list.GetValue(i));
fdbdae7ea647 (svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents: 9713
diff changeset
   320
	}
fdbdae7ea647 (svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents: 9713
diff changeset
   321
}
fdbdae7ea647 (svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents: 9713
diff changeset
   322
9682
d031eb183733 (svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents: 9672
diff changeset
   323
function Regression::Event()
d031eb183733 (svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents: 9672
diff changeset
   324
{
d031eb183733 (svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents: 9672
diff changeset
   325
	print("");
d031eb183733 (svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents: 9672
diff changeset
   326
	print("--Event--");
d031eb183733 (svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents: 9672
diff changeset
   327
	AIEventController.Test();
d031eb183733 (svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents: 9672
diff changeset
   328
	local e = AIEventController.GetNextEvent();
9684
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9682
diff changeset
   329
	print("  GetNextEvent:      " + (e == null ? "null" : "instance"));
9682
d031eb183733 (svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents: 9672
diff changeset
   330
	print("    GetEventType:    " + e.GetEventType());
d031eb183733 (svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents: 9672
diff changeset
   331
	local c = AIEventTest.Convert(e);
9684
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9682
diff changeset
   332
	print("    Convert:         " + (c == null ? "null" : "instance"));
9682
d031eb183733 (svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents: 9672
diff changeset
   333
	print("      GetTest:       " + c.GetTest());
d031eb183733 (svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents: 9672
diff changeset
   334
d031eb183733 (svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents: 9672
diff changeset
   335
	print("  DisableEvent(1):   done");
d031eb183733 (svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents: 9672
diff changeset
   336
	AIEventController.DisableEvent(1);
d031eb183733 (svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents: 9672
diff changeset
   337
	AIEventController.Test();
d031eb183733 (svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents: 9672
diff changeset
   338
	e = AIEventController.GetNextEvent();
9684
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9682
diff changeset
   339
	print("  GetNextEvent:      " + (e == null ? "null" : "instance"));
9682
d031eb183733 (svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents: 9672
diff changeset
   340
d031eb183733 (svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents: 9672
diff changeset
   341
	print("  EnableEvent(1):    done");
d031eb183733 (svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents: 9672
diff changeset
   342
	AIEventController.EnableEvent(1);
d031eb183733 (svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents: 9672
diff changeset
   343
	AIEventController.Test();
d031eb183733 (svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents: 9672
diff changeset
   344
	e = AIEventController.GetNextEvent();
9684
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9682
diff changeset
   345
	print("  GetNextEvent:      " + (e == null ? "null" : "instance"));
9682
d031eb183733 (svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents: 9672
diff changeset
   346
d031eb183733 (svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents: 9672
diff changeset
   347
	{
d031eb183733 (svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents: 9672
diff changeset
   348
		print("  DisableAllEvents():done");
d031eb183733 (svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents: 9672
diff changeset
   349
		AIEventController.DisableAllEvents();
d031eb183733 (svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents: 9672
diff changeset
   350
		AIEventController.Test();
d031eb183733 (svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents: 9672
diff changeset
   351
		e = AIEventController.GetNextEvent();
9684
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9682
diff changeset
   352
		print("  GetNextEvent:      " + (e == null ? "null" : "instance"));
9682
d031eb183733 (svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents: 9672
diff changeset
   353
	}
d031eb183733 (svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents: 9672
diff changeset
   354
d031eb183733 (svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents: 9672
diff changeset
   355
	print("  EnableEvent(1):    done");
d031eb183733 (svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents: 9672
diff changeset
   356
	AIEventController.EnableEvent(1);
d031eb183733 (svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents: 9672
diff changeset
   357
	AIEventController.Test();
d031eb183733 (svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents: 9672
diff changeset
   358
	e = AIEventController.GetNextEvent();
9684
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9682
diff changeset
   359
	print("  GetNextEvent:      " + (e == null ? "null" : "instance"));
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9682
diff changeset
   360
	e = AIEventController.GetNextEvent();
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9682
diff changeset
   361
	print("  GetNextEvent:      " + (e == null ? "null" : "instance"));
9823
0b7f816cf46f (svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents: 9814
diff changeset
   362
0b7f816cf46f (svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents: 9814
diff changeset
   363
	AIEventController.EnableAllEvents();
9682
d031eb183733 (svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents: 9672
diff changeset
   364
}
d031eb183733 (svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents: 9672
diff changeset
   365
9460
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
   366
function Regression::Industry()
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
   367
{
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
   368
	local j = 0;
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
   369
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
   370
	print("");
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
   371
	print("--Industry--");
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   372
	print("  GetMaxIndustryID():  " + AIIndustry.GetMaxIndustryID());
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   373
	print("  GetIndustryCount():  " + AIIndustry.GetIndustryCount());
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   374
	for (local i = -1; i < AIIndustry.GetMaxIndustryID() + 1; i++) {
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   375
		if (AIIndustry.IsValidIndustry(i)) j++;
9460
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
   376
		print("  Industry " + i);
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   377
		print("    IsValidIndustry(): " + AIIndustry.IsValidIndustry(i));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   378
		print("    GetName():         " + AIIndustry.GetName(i));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   379
		print("    GetLocation():     " + AIIndustry.GetLocation(i));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   380
		print("    GetProduction():   " + AIIndustry.GetProduction(i, 1));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   381
		print("    IsCargoAccepted(): " + AIIndustry.IsCargoAccepted(i, 1));
9810
a84fc1be9e3b (svn r12327) [NoAI] -Add: GetLastMonth(Production|Transported) (Morloth)
truebrain
parents: 9809
diff changeset
   382
a84fc1be9e3b (svn r12327) [NoAI] -Add: GetLastMonth(Production|Transported) (Morloth)
truebrain
parents: 9809
diff changeset
   383
		local cargo_list = AICargoList();
a84fc1be9e3b (svn r12327) [NoAI] -Add: GetLastMonth(Production|Transported) (Morloth)
truebrain
parents: 9809
diff changeset
   384
		for (local j = cargo_list.Begin(); cargo_list.HasNext(); j = cargo_list.Next()) {
a84fc1be9e3b (svn r12327) [NoAI] -Add: GetLastMonth(Production|Transported) (Morloth)
truebrain
parents: 9809
diff changeset
   385
			if (AIIndustry.GetProduction(i, j) > 0) {
a84fc1be9e3b (svn r12327) [NoAI] -Add: GetLastMonth(Production|Transported) (Morloth)
truebrain
parents: 9809
diff changeset
   386
				print("	   GetLastMonthProduction(): " + AIIndustry.GetLastMonthProduction(i, j));
a84fc1be9e3b (svn r12327) [NoAI] -Add: GetLastMonth(Production|Transported) (Morloth)
truebrain
parents: 9809
diff changeset
   387
				print("	   GetLastMonthTransported(): " + AIIndustry.GetLastMonthTransported(i, j));
a84fc1be9e3b (svn r12327) [NoAI] -Add: GetLastMonth(Production|Transported) (Morloth)
truebrain
parents: 9809
diff changeset
   388
			}
a84fc1be9e3b (svn r12327) [NoAI] -Add: GetLastMonth(Production|Transported) (Morloth)
truebrain
parents: 9809
diff changeset
   389
		}
9460
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
   390
	}
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
   391
	print("  Valid Industries:    " + j);
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   392
	print("  GetIndustryCount():  " + AIIndustry.GetIndustryCount());
9460
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
   393
}
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
   394
9649
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
   395
function Regression::IndustryList()
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
   396
{
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
   397
	local list = AIIndustryList();
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
   398
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
   399
	print("");
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
   400
	print("--IndustryList--");
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
   401
	print("  Count():             " + list.Count());
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   402
	list.Valuate(AIIndustry.GetLocation);
9649
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
   403
	print("  Location ListDump:");
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
   404
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
   405
		print("    " + i + " => " + list.GetValue(i));
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
   406
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   407
	list.Valuate(AIIndustry.GetDistanceManhattanToTile, 30000);
9655
e8e43f333832 (svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents: 9654
diff changeset
   408
	print("  DistanceManhattanToTile(30000) ListDump:");
e8e43f333832 (svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents: 9654
diff changeset
   409
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
e8e43f333832 (svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents: 9654
diff changeset
   410
		print("    " + i + " => " + list.GetValue(i));
e8e43f333832 (svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents: 9654
diff changeset
   411
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   412
	list.Valuate(AIIndustry.GetDistanceSquareToTile, 30000);
9655
e8e43f333832 (svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents: 9654
diff changeset
   413
	print("  DistanceSquareToTile(30000) ListDump:");
e8e43f333832 (svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents: 9654
diff changeset
   414
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
e8e43f333832 (svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents: 9654
diff changeset
   415
		print("    " + i + " => " + list.GetValue(i));
e8e43f333832 (svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents: 9654
diff changeset
   416
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   417
	list.Valuate(AIIndustry.IsCargoAccepted, 1);
9710
ba44f8c1fd52 (svn r11294) [NoAI] -Add: added AIIndustry::IsCargoAccepted + Valuator (on request by Kilinich)
truelight
parents: 9709
diff changeset
   418
	print("  CargoAccepted(1) ListDump:");
ba44f8c1fd52 (svn r11294) [NoAI] -Add: added AIIndustry::IsCargoAccepted + Valuator (on request by Kilinich)
truelight
parents: 9709
diff changeset
   419
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
ba44f8c1fd52 (svn r11294) [NoAI] -Add: added AIIndustry::IsCargoAccepted + Valuator (on request by Kilinich)
truelight
parents: 9709
diff changeset
   420
		print("    " + i + " => " + list.GetValue(i));
ba44f8c1fd52 (svn r11294) [NoAI] -Add: added AIIndustry::IsCargoAccepted + Valuator (on request by Kilinich)
truelight
parents: 9709
diff changeset
   421
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   422
	list.Valuate(AIIndustry.GetProduction, 1);
9649
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
   423
	list.KeepAboveValue(50);
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
   424
	print("  KeepAboveValue(50): done");
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
   425
	print("  Count():             " + list.Count());
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
   426
	print("  Production ListDump:");
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
   427
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
   428
		print("    " + i + " => " + list.GetValue(i));
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
   429
	}
9776
ee9923d46fba (svn r12270) [NoAI] -Add: added AIIndustryList_CargoAccepting and AIIndustryList_CargoProducing, which gives you Industry Lists with from where to where you can move cargo
truebrain
parents: 9773
diff changeset
   430
ee9923d46fba (svn r12270) [NoAI] -Add: added AIIndustryList_CargoAccepting and AIIndustryList_CargoProducing, which gives you Industry Lists with from where to where you can move cargo
truebrain
parents: 9773
diff changeset
   431
	list = AIIndustryList_CargoAccepting(1);
ee9923d46fba (svn r12270) [NoAI] -Add: added AIIndustryList_CargoAccepting and AIIndustryList_CargoProducing, which gives you Industry Lists with from where to where you can move cargo
truebrain
parents: 9773
diff changeset
   432
	print("--IndustryList_CargoAccepting--");
ee9923d46fba (svn r12270) [NoAI] -Add: added AIIndustryList_CargoAccepting and AIIndustryList_CargoProducing, which gives you Industry Lists with from where to where you can move cargo
truebrain
parents: 9773
diff changeset
   433
	print("  Count():             " + list.Count());
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   434
	list.Valuate(AIIndustry.GetLocation);
9776
ee9923d46fba (svn r12270) [NoAI] -Add: added AIIndustryList_CargoAccepting and AIIndustryList_CargoProducing, which gives you Industry Lists with from where to where you can move cargo
truebrain
parents: 9773
diff changeset
   435
	print("  Location ListDump:");
ee9923d46fba (svn r12270) [NoAI] -Add: added AIIndustryList_CargoAccepting and AIIndustryList_CargoProducing, which gives you Industry Lists with from where to where you can move cargo
truebrain
parents: 9773
diff changeset
   436
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
ee9923d46fba (svn r12270) [NoAI] -Add: added AIIndustryList_CargoAccepting and AIIndustryList_CargoProducing, which gives you Industry Lists with from where to where you can move cargo
truebrain
parents: 9773
diff changeset
   437
		print("    " + i + " => " + list.GetValue(i));
ee9923d46fba (svn r12270) [NoAI] -Add: added AIIndustryList_CargoAccepting and AIIndustryList_CargoProducing, which gives you Industry Lists with from where to where you can move cargo
truebrain
parents: 9773
diff changeset
   438
	}
ee9923d46fba (svn r12270) [NoAI] -Add: added AIIndustryList_CargoAccepting and AIIndustryList_CargoProducing, which gives you Industry Lists with from where to where you can move cargo
truebrain
parents: 9773
diff changeset
   439
ee9923d46fba (svn r12270) [NoAI] -Add: added AIIndustryList_CargoAccepting and AIIndustryList_CargoProducing, which gives you Industry Lists with from where to where you can move cargo
truebrain
parents: 9773
diff changeset
   440
	list = AIIndustryList_CargoProducing(1);
ee9923d46fba (svn r12270) [NoAI] -Add: added AIIndustryList_CargoAccepting and AIIndustryList_CargoProducing, which gives you Industry Lists with from where to where you can move cargo
truebrain
parents: 9773
diff changeset
   441
	print("--IndustryList_CargoProducing--");
ee9923d46fba (svn r12270) [NoAI] -Add: added AIIndustryList_CargoAccepting and AIIndustryList_CargoProducing, which gives you Industry Lists with from where to where you can move cargo
truebrain
parents: 9773
diff changeset
   442
	print("  Count():             " + list.Count());
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   443
	list.Valuate(AIIndustry.GetLocation);
9776
ee9923d46fba (svn r12270) [NoAI] -Add: added AIIndustryList_CargoAccepting and AIIndustryList_CargoProducing, which gives you Industry Lists with from where to where you can move cargo
truebrain
parents: 9773
diff changeset
   444
	print("  Location ListDump:");
ee9923d46fba (svn r12270) [NoAI] -Add: added AIIndustryList_CargoAccepting and AIIndustryList_CargoProducing, which gives you Industry Lists with from where to where you can move cargo
truebrain
parents: 9773
diff changeset
   445
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
ee9923d46fba (svn r12270) [NoAI] -Add: added AIIndustryList_CargoAccepting and AIIndustryList_CargoProducing, which gives you Industry Lists with from where to where you can move cargo
truebrain
parents: 9773
diff changeset
   446
		print("    " + i + " => " + list.GetValue(i));
ee9923d46fba (svn r12270) [NoAI] -Add: added AIIndustryList_CargoAccepting and AIIndustryList_CargoProducing, which gives you Industry Lists with from where to where you can move cargo
truebrain
parents: 9773
diff changeset
   447
	}
9649
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
   448
}
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
   449
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   450
function CustomValuator(list_id)
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   451
{
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   452
	return list_id * 4343;
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   453
}
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   454
9579
632263c0cf5a (svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents: 9575
diff changeset
   455
function Regression::List()
632263c0cf5a (svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents: 9575
diff changeset
   456
{
632263c0cf5a (svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents: 9575
diff changeset
   457
	local list = AIList();
632263c0cf5a (svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents: 9575
diff changeset
   458
632263c0cf5a (svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents: 9575
diff changeset
   459
	print("");
632263c0cf5a (svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents: 9575
diff changeset
   460
	print("--List--");
632263c0cf5a (svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents: 9575
diff changeset
   461
632263c0cf5a (svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents: 9575
diff changeset
   462
	print("  IsEmpty():     " + list.IsEmpty());
9664
c5741021bf59 (svn r10577) [NoAI] -Add: added ChangeItem to AIList
truelight
parents: 9660
diff changeset
   463
	list.AddItem(1, 1);
c5741021bf59 (svn r10577) [NoAI] -Add: added ChangeItem to AIList
truelight
parents: 9660
diff changeset
   464
	list.AddItem(2, 2);
9579
632263c0cf5a (svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents: 9575
diff changeset
   465
	for (local i = 1000; i < 1100; i++) {
9664
c5741021bf59 (svn r10577) [NoAI] -Add: added ChangeItem to AIList
truelight
parents: 9660
diff changeset
   466
		list.AddItem(i, i);
9579
632263c0cf5a (svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents: 9575
diff changeset
   467
	}
632263c0cf5a (svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents: 9575
diff changeset
   468
	list.RemoveItem(1050);
632263c0cf5a (svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents: 9575
diff changeset
   469
	list.RemoveItem(1150);
9664
c5741021bf59 (svn r10577) [NoAI] -Add: added ChangeItem to AIList
truelight
parents: 9660
diff changeset
   470
	list.ChangeItem(1051, 12);
9579
632263c0cf5a (svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents: 9575
diff changeset
   471
	print("  Count():       " + list.Count());
632263c0cf5a (svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents: 9575
diff changeset
   472
	print("  HasItem(1050): " + list.HasItem(1050));
632263c0cf5a (svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents: 9575
diff changeset
   473
	print("  HasItem(1051): " + list.HasItem(1051));
632263c0cf5a (svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents: 9575
diff changeset
   474
	print("  IsEmpty():     " + list.IsEmpty());
9665
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   475
	list.Sort(AIAbstractList.SORT_BY_ITEM, true);
9579
632263c0cf5a (svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents: 9575
diff changeset
   476
	print("  List Dump:");
632263c0cf5a (svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents: 9575
diff changeset
   477
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
632263c0cf5a (svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents: 9575
diff changeset
   478
		print("    " + i + " => " + list.GetValue(i));
632263c0cf5a (svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents: 9575
diff changeset
   479
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   480
	list.Valuate(CustomValuator);
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   481
	print("  Custom ListDump:");
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   482
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   483
		print("    " + i + " => " + list.GetValue(i));
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   484
	}
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   485
	list.Valuate(AIBase.RandItem);
9660
d0a430e8310b (svn r10569) [NoAI] -Add: added AIListRandomize as Valuator for all lists to attach a random value to all items
truelight
parents: 9658
diff changeset
   486
	print("  Randomize ListDump:");
d0a430e8310b (svn r10569) [NoAI] -Add: added AIListRandomize as Valuator for all lists to attach a random value to all items
truelight
parents: 9658
diff changeset
   487
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
d0a430e8310b (svn r10569) [NoAI] -Add: added AIListRandomize as Valuator for all lists to attach a random value to all items
truelight
parents: 9658
diff changeset
   488
		print("    " + i + " => " + list.GetValue(i));
d0a430e8310b (svn r10569) [NoAI] -Add: added AIListRandomize as Valuator for all lists to attach a random value to all items
truelight
parents: 9658
diff changeset
   489
	}
9665
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   490
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   491
	list.KeepTop(10);
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   492
	print("  KeepTop(10):");
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   493
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   494
		print("    " + i + " => " + list.GetValue(i));
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   495
	}
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   496
	list.KeepBottom(8);
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   497
	print("  KeepBottom(8):");
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   498
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   499
		print("    " + i + " => " + list.GetValue(i));
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   500
	}
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   501
	list.RemoveBottom(2);
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   502
	print("  RemoveBottom(2):");
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   503
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   504
		print("    " + i + " => " + list.GetValue(i));
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   505
	}
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   506
	list.RemoveTop(2);
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   507
	print("  RemoveTop(2):");
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   508
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   509
		print("    " + i + " => " + list.GetValue(i));
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   510
	}
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   511
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   512
	local list2 = AIList();
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   513
	list2.AddItem(1003, 0);
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   514
	list2.AddItem(1004, 0);
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   515
	list.RemoveList(list2);
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   516
	print("  RemoveList({1003, 1004}):");
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   517
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   518
		print("    " + i + " => " + list.GetValue(i));
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   519
	}
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   520
	list2.AddItem(1005, 0);
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   521
	list.KeepList(list2);
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   522
	print("  KeepList({1003, 1004, 1005}):");
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   523
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   524
		print("    " + i + " => " + list.GetValue(i));
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   525
	}
9796
83d54622190c (svn r12300) [NoAI] -Add: added AIAbstractList.AddList() (on request by Progman)
truebrain
parents: 9794
diff changeset
   526
	list2.Clear();
83d54622190c (svn r12300) [NoAI] -Add: added AIAbstractList.AddList() (on request by Progman)
truebrain
parents: 9794
diff changeset
   527
	for (local i = 4000; i < 4003; i++) {
83d54622190c (svn r12300) [NoAI] -Add: added AIAbstractList.AddList() (on request by Progman)
truebrain
parents: 9794
diff changeset
   528
		list2.AddItem(i, i);
83d54622190c (svn r12300) [NoAI] -Add: added AIAbstractList.AddList() (on request by Progman)
truebrain
parents: 9794
diff changeset
   529
	}
83d54622190c (svn r12300) [NoAI] -Add: added AIAbstractList.AddList() (on request by Progman)
truebrain
parents: 9794
diff changeset
   530
	list2.AddItem(1005, 1005);
83d54622190c (svn r12300) [NoAI] -Add: added AIAbstractList.AddList() (on request by Progman)
truebrain
parents: 9794
diff changeset
   531
	list.AddList(list2);
83d54622190c (svn r12300) [NoAI] -Add: added AIAbstractList.AddList() (on request by Progman)
truebrain
parents: 9794
diff changeset
   532
	print("  AddList({1005, 4000, 4001, 4002}):");
83d54622190c (svn r12300) [NoAI] -Add: added AIAbstractList.AddList() (on request by Progman)
truebrain
parents: 9794
diff changeset
   533
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
83d54622190c (svn r12300) [NoAI] -Add: added AIAbstractList.AddList() (on request by Progman)
truebrain
parents: 9794
diff changeset
   534
		print("    " + i + " => " + list.GetValue(i));
83d54622190c (svn r12300) [NoAI] -Add: added AIAbstractList.AddList() (on request by Progman)
truebrain
parents: 9794
diff changeset
   535
	}
9665
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   536
9579
632263c0cf5a (svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents: 9575
diff changeset
   537
	list.Clear();
632263c0cf5a (svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents: 9575
diff changeset
   538
	print("  IsEmpty():     " + list.IsEmpty());
632263c0cf5a (svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents: 9575
diff changeset
   539
}
632263c0cf5a (svn r9603) [NoAI] -Add: added AIList(), a simple list in which you can add item/value pairs. You can sort them, walk them, and valuate them
truelight
parents: 9575
diff changeset
   540
9460
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
   541
function Regression::Map()
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
   542
{
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
   543
	print("");
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
   544
	print("--Map--");
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   545
	print("  GetMapSize():     " + AIMap.GetMapSize());
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   546
	print("  GetMapSizeX():    " + AIMap.GetMapSizeX());
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   547
	print("  GetMapSizeY():    " + AIMap.GetMapSizeY());
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   548
	print("  GetTileX(123):    " + AIMap.GetTileX(123));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   549
	print("  GetTileY(123):    " + AIMap.GetTileY(123));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   550
	print("  GetTileIndex():   " + AIMap.GetTileIndex(123, 0));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   551
	print("  GetTileIndex():   " + AIMap.GetTileIndex(0, 123));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   552
	print("  GetTileIndex():   " + AIMap.GetTileIndex(0, 0));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   553
	print("  GetTileIndex():   " + AIMap.GetTileIndex(-1, -1));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   554
	print("  GetTileIndex():   " + AIMap.GetTileIndex(10000, 10000));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   555
	print("  IsValidTile(123): " + AIMap.IsValidTile(123));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   556
	print("  GetTileX(124):    " + AIMap.GetTileX(124));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   557
	print("  GetTileY(124):    " + AIMap.GetTileY(124));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   558
	print("  IsValidTile(124): " + AIMap.IsValidTile(124));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   559
	print("  IsValidTile(0):   " + AIMap.IsValidTile(0));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   560
	print("  IsValidTile(-1):  " + AIMap.IsValidTile(-1));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   561
	print("  IsValidTile():    " + AIMap.IsValidTile(AIMap.GetMapSize()));
9801
03a3eebd7fb7 (svn r12307) [NoAI] -Codechange: as followup on r12303 (trunk), use ::IsValidTile to check if a tile is inside the map, instead of all our custom ways
truebrain
parents: 9796
diff changeset
   562
	print("  IsValidTile():    " + AIMap.IsValidTile(AIMap.GetMapSize() - AIMap.GetMapSizeX() - 2));
9834
9abe20fc83e5 (svn r12497) [NoAI] -Change [API CHANGE]: AIMap.DemolishTile -> AITile.DemolishTile (that makes much more sense, doesn't it? ;))
truebrain
parents: 9831
diff changeset
   563
	print("  DemolishTile():   " + AITile.DemolishTile(19592));
9abe20fc83e5 (svn r12497) [NoAI] -Change [API CHANGE]: AIMap.DemolishTile -> AITile.DemolishTile (that makes much more sense, doesn't it? ;))
truebrain
parents: 9831
diff changeset
   564
	print("  DemolishTile():   " + AITile.DemolishTile(19335));
9492
1aeee24046d8 (svn r9362) [NoAI] -Add: added the new AIMap() functions to regression-test
truelight
parents: 9487
diff changeset
   565
	print("  Distance");
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   566
	print("    DistanceManhattan(): " + AIMap.DistanceManhattan(1, 10000));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   567
	print("    DistanceMax():       " + AIMap.DistanceMax(1, 10000));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   568
	print("    DistanceSquare():    " + AIMap.DistanceSquare(1, 10000));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   569
	print("    DistanceFromEdge():  " + AIMap.DistanceFromEdge(10000));
9460
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
   570
}
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
   571
9691
1231d4e5f5aa (svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents: 9684
diff changeset
   572
function Regression::Marine()
1231d4e5f5aa (svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents: 9684
diff changeset
   573
{
1231d4e5f5aa (svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents: 9684
diff changeset
   574
	print("");
1231d4e5f5aa (svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents: 9684
diff changeset
   575
	print("--AIMarine--");
1231d4e5f5aa (svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents: 9684
diff changeset
   576
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   577
	print("  IsWaterDepotTile():   " + AIMarine.IsWaterDepotTile(32116));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   578
	print("  IsDockTile():         " + AIMarine.IsDockTile(32116));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   579
	print("  IsBuoyTile():         " + AIMarine.IsBuoyTile(32116));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   580
	print("  IsLockTile():         " + AIMarine.IsLockTile(32116));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   581
	print("  IsCanalTile():        " + AIMarine.IsCanalTile(32116));
9691
1231d4e5f5aa (svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents: 9684
diff changeset
   582
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   583
	print("  GetBankBalance():     " + AICompany.GetBankBalance(AICompany.MY_COMPANY));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   584
	print("  BuildWaterDepot():    " + AIMarine.BuildWaterDepot(28479, false));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   585
	print("  BuildDock():          " + AIMarine.BuildDock(29253));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   586
	print("  BuildBuoy():          " + AIMarine.BuildBuoy(28481));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   587
	print("  BuildLock():          " + AIMarine.BuildLock(28487));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   588
	print("  BuildCanal():         " + AIMarine.BuildCanal(32127));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   589
	print("  IsWaterDepotTile():   " + AIMarine.IsWaterDepotTile(28479));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   590
	print("  IsDockTile():         " + AIMarine.IsDockTile(29253));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   591
	print("  IsBuoyTile():         " + AIMarine.IsBuoyTile(28481));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   592
	print("  IsLockTile():         " + AIMarine.IsLockTile(28487));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   593
	print("  IsCanalTile():        " + AIMarine.IsCanalTile(32127));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   594
	print("  GetBankBalance():     " + AICompany.GetBankBalance(AICompany.MY_COMPANY));
9691
1231d4e5f5aa (svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents: 9684
diff changeset
   595
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   596
	print("  RemoveWaterDepot():   " + AIMarine.RemoveWaterDepot(28479));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   597
	print("  RemoveDock():         " + AIMarine.RemoveDock(29253));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   598
	print("  RemoveBuoy():         " + AIMarine.RemoveBuoy(28481));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   599
	print("  RemoveLock():         " + AIMarine.RemoveLock(28487));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   600
	print("  RemoveCanal():        " + AIMarine.RemoveCanal(32127));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   601
	print("  IsWaterDepotTile():   " + AIMarine.IsWaterDepotTile(28479));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   602
	print("  IsDockTile():         " + AIMarine.IsDockTile(29253));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   603
	print("  IsBuoyTile():         " + AIMarine.IsBuoyTile(28481));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   604
	print("  IsLockTile():         " + AIMarine.IsLockTile(28487));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   605
	print("  IsCanalTile():        " + AIMarine.IsCanalTile(32127));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   606
	print("  GetBankBalance():     " + AICompany.GetBankBalance(AICompany.MY_COMPANY));
9691
1231d4e5f5aa (svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents: 9684
diff changeset
   607
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   608
	print("  BuildWaterDepot():    " + AIMarine.BuildWaterDepot(28479, false));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   609
	print("  BuildDock():          " + AIMarine.BuildDock(29253));
9691
1231d4e5f5aa (svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents: 9684
diff changeset
   610
}
1231d4e5f5aa (svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents: 9684
diff changeset
   611
9546
fde20f518285 (svn r9477) [NoAI] -Add: added regression-test for AIOrder()
truelight
parents: 9541
diff changeset
   612
function Regression::Order()
fde20f518285 (svn r9477) [NoAI] -Add: added regression-test for AIOrder()
truelight
parents: 9541
diff changeset
   613
{
fde20f518285 (svn r9477) [NoAI] -Add: added regression-test for AIOrder()
truelight
parents: 9541
diff changeset
   614
	print("");
fde20f518285 (svn r9477) [NoAI] -Add: added regression-test for AIOrder()
truelight
parents: 9541
diff changeset
   615
	print("--Order--");
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   616
	print("  GetNumberOfOrders():   " + AIOrder.GetNumberOfOrders(11));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   617
	print("  GetOrderDestination(): " + AIOrder.GetOrderDestination(11, 1));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   618
	print("  AreOrderFlagsValid():  " + AIOrder.AreOrderFlagsValid(33416, AIOrder.AIOF_TRANSFER));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   619
	print("  IsValidVehicleOrder(): " + AIOrder.IsValidVehicleOrder(11, 1));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   620
	print("  GetOrderFlags():       " + AIOrder.GetOrderFlags(11, 1));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   621
	print("  AppendOrder():         " + AIOrder.AppendOrder(11, 33416, AIOrder.AIOF_TRANSFER));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   622
	print("  InsertOrder():         " + AIOrder.InsertOrder(11, 0, 33416, AIOrder.AIOF_TRANSFER));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   623
	print("  GetNumberOfOrders():   " + AIOrder.GetNumberOfOrders(11));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   624
	print("  IsValidVehicleOrder(): " + AIOrder.IsValidVehicleOrder(11, 1));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   625
	print("  RemoveOrder():         " + AIOrder.RemoveOrder(11, 0));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   626
	print("  ChangeOrder():         " + AIOrder.ChangeOrder(11, 0, AIOrder.AIOF_FULL_LOAD));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   627
	print("  GetOrderDestination(): " + AIOrder.GetOrderDestination(11, 0));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   628
	print("  CopyOrders():          " + AIOrder.CopyOrders(11, 1));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   629
	print("  CopyOrders():          " + AIOrder.CopyOrders(12, 11));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   630
	print("  ShareOrders():         " + AIOrder.ShareOrders(12, 1));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   631
	print("  ShareOrders():         " + AIOrder.ShareOrders(12, 11));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   632
	print("  UnshareOrders():       " + AIOrder.UnshareOrders(12));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   633
	print("  AppendOrder():         " + AIOrder.AppendOrder(11, 33421, AIOrder.AIOF_NONE));
9645
25126afa0c25 (svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents: 9638
diff changeset
   634
9745
fb2454d70f37 (svn r12225) [NoAI] -Change [API CHANGE]: AIStationVehicleList -> AIVehicleList_Station (WATCH THE NAMES CAREFULLY!)
truebrain
parents: 9737
diff changeset
   635
	local list = AIStationList_Vehicle(11);
9645
25126afa0c25 (svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents: 9638
diff changeset
   636
25126afa0c25 (svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents: 9638
diff changeset
   637
	print("");
9745
fb2454d70f37 (svn r12225) [NoAI] -Change [API CHANGE]: AIStationVehicleList -> AIVehicleList_Station (WATCH THE NAMES CAREFULLY!)
truebrain
parents: 9737
diff changeset
   638
	print("--StationList_Vehicle--");
9645
25126afa0c25 (svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents: 9638
diff changeset
   639
	print("  Count():             " + list.Count());
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   640
	list.Valuate(AIStation.GetLocation);
9645
25126afa0c25 (svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents: 9638
diff changeset
   641
	print("  Location ListDump:");
25126afa0c25 (svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents: 9638
diff changeset
   642
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
25126afa0c25 (svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents: 9638
diff changeset
   643
		print("    " + i + " => " + list.GetValue(i));
25126afa0c25 (svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents: 9638
diff changeset
   644
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   645
	list.Valuate(AIStation.GetCargoWaiting, 0);
9645
25126afa0c25 (svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents: 9638
diff changeset
   646
	print("  CargoWaiting(0) ListDump:");
25126afa0c25 (svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents: 9638
diff changeset
   647
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
25126afa0c25 (svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents: 9638
diff changeset
   648
		print("    " + i + " => " + list.GetValue(i));
25126afa0c25 (svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents: 9638
diff changeset
   649
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   650
	list.Valuate(AIStation.GetCargoWaiting, 1);
9645
25126afa0c25 (svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents: 9638
diff changeset
   651
	print("  CargoWaiting(1) ListDump:");
25126afa0c25 (svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents: 9638
diff changeset
   652
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
25126afa0c25 (svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents: 9638
diff changeset
   653
		print("    " + i + " => " + list.GetValue(i));
25126afa0c25 (svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents: 9638
diff changeset
   654
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   655
	list.Valuate(AIStation.GetCargoRating, 1);
9648
760b7b504e37 (svn r10543) [NoAI] -Add: added AIStationListCargoRating as valuator for a station list
truelight
parents: 9647
diff changeset
   656
	print("  CargoRating(1) ListDump:");
760b7b504e37 (svn r10543) [NoAI] -Add: added AIStationListCargoRating as valuator for a station list
truelight
parents: 9647
diff changeset
   657
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
760b7b504e37 (svn r10543) [NoAI] -Add: added AIStationListCargoRating as valuator for a station list
truelight
parents: 9647
diff changeset
   658
		print("    " + i + " => " + list.GetValue(i));
760b7b504e37 (svn r10543) [NoAI] -Add: added AIStationListCargoRating as valuator for a station list
truelight
parents: 9647
diff changeset
   659
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   660
	list.Valuate(AIStation.GetDistanceManhattanToTile, 30000);
9655
e8e43f333832 (svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents: 9654
diff changeset
   661
	print("  DistanceManhattanToTile(30000) ListDump:");
e8e43f333832 (svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents: 9654
diff changeset
   662
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
e8e43f333832 (svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents: 9654
diff changeset
   663
		print("    " + i + " => " + list.GetValue(i));
e8e43f333832 (svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents: 9654
diff changeset
   664
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   665
	list.Valuate(AIStation.GetDistanceSquareToTile, 30000);
9655
e8e43f333832 (svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents: 9654
diff changeset
   666
	print("  DistanceSquareToTile(30000) ListDump:");
e8e43f333832 (svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents: 9654
diff changeset
   667
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
e8e43f333832 (svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents: 9654
diff changeset
   668
		print("    " + i + " => " + list.GetValue(i));
e8e43f333832 (svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents: 9654
diff changeset
   669
	}
9647
c17046b1b8a2 (svn r10540) [NoAI] -Add: added AIStationVehicleList, which lists all vehicles that go to a given station
truelight
parents: 9645
diff changeset
   670
9745
fb2454d70f37 (svn r12225) [NoAI] -Change [API CHANGE]: AIStationVehicleList -> AIVehicleList_Station (WATCH THE NAMES CAREFULLY!)
truebrain
parents: 9737
diff changeset
   671
	list = AIVehicleList_Station(3);
9647
c17046b1b8a2 (svn r10540) [NoAI] -Add: added AIStationVehicleList, which lists all vehicles that go to a given station
truelight
parents: 9645
diff changeset
   672
c17046b1b8a2 (svn r10540) [NoAI] -Add: added AIStationVehicleList, which lists all vehicles that go to a given station
truelight
parents: 9645
diff changeset
   673
	print("");
9745
fb2454d70f37 (svn r12225) [NoAI] -Change [API CHANGE]: AIStationVehicleList -> AIVehicleList_Station (WATCH THE NAMES CAREFULLY!)
truebrain
parents: 9737
diff changeset
   674
	print("--VehicleList_Station--");
9647
c17046b1b8a2 (svn r10540) [NoAI] -Add: added AIStationVehicleList, which lists all vehicles that go to a given station
truelight
parents: 9645
diff changeset
   675
	print("  Count():             " + list.Count());
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   676
	list.Valuate(AIVehicle.GetLocation);
9647
c17046b1b8a2 (svn r10540) [NoAI] -Add: added AIStationVehicleList, which lists all vehicles that go to a given station
truelight
parents: 9645
diff changeset
   677
	print("  Location ListDump:");
c17046b1b8a2 (svn r10540) [NoAI] -Add: added AIStationVehicleList, which lists all vehicles that go to a given station
truelight
parents: 9645
diff changeset
   678
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
c17046b1b8a2 (svn r10540) [NoAI] -Add: added AIStationVehicleList, which lists all vehicles that go to a given station
truelight
parents: 9645
diff changeset
   679
		print("    " + i + " => " + list.GetValue(i));
c17046b1b8a2 (svn r10540) [NoAI] -Add: added AIStationVehicleList, which lists all vehicles that go to a given station
truelight
parents: 9645
diff changeset
   680
	}
9546
fde20f518285 (svn r9477) [NoAI] -Add: added regression-test for AIOrder()
truelight
parents: 9541
diff changeset
   681
}
fde20f518285 (svn r9477) [NoAI] -Add: added regression-test for AIOrder()
truelight
parents: 9541
diff changeset
   682
9485
df09b849ca60 (svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents: 9470
diff changeset
   683
function Regression::Road()
df09b849ca60 (svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents: 9470
diff changeset
   684
{
df09b849ca60 (svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents: 9470
diff changeset
   685
	print("");
df09b849ca60 (svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents: 9470
diff changeset
   686
	print("--Road--");
df09b849ca60 (svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents: 9470
diff changeset
   687
	print("  Road");
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   688
	print("    IsRoadTile():                  " + AIRoad.IsRoadTile(33411));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   689
	print("    BuildRoad():                   " + AIRoad.BuildRoad(0, 1));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   690
	print("    BuildRoad():                   " + AIRoad.BuildRoad(33411, 33411));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   691
	print("    BuildRoad():                   " + AIRoad.BuildRoad(33411, 33414));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   692
	print("    AreRoadTilesConnected():       " + AIRoad.AreRoadTilesConnected(33412, 33413));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   693
	print("    IsRoadTile():                  " + AIRoad.IsRoadTile(33411));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   694
	print("    GetNeighbourRoadCount():       " + AIRoad.GetNeighbourRoadCount(33412));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   695
	print("    RemoveRoad():                  " + AIRoad.RemoveRoad(33411, 33411));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   696
	print("    RemoveRoad():                  " + AIRoad.RemoveRoad(33411, 33412));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   697
	print("    RemoveRoad():                  " + AIRoad.RemoveRoad(19590, 19590));
9485
df09b849ca60 (svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents: 9470
diff changeset
   698
df09b849ca60 (svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents: 9470
diff changeset
   699
	print("  Depot");
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   700
	print("    IsRoadTile():                  " + AIRoad.IsRoadTile(33411));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   701
	print("    BuildRoadDepot():              " + AIRoad.BuildRoadDepot(0, 1));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   702
	print("    BuildRoadDepot():              " + AIRoad.BuildRoadDepot(33411, 33411));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   703
	print("    BuildRoadDepot():              " + AIRoad.BuildRoadDepot(33411, 33414));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   704
	print("    BuildRoadDepot():              " + AIRoad.BuildRoadDepot(33411, 33412));
9844
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents: 9834
diff changeset
   705
	print("    GetLastError():                " + AIError.GetLastError());
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents: 9834
diff changeset
   706
	print("    GetLastErrorString():          " + AIError.GetLastErrorString());
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents: 9834
diff changeset
   707
	print("    GetErrorCategory():            " + AIError.GetErrorCategory());
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   708
	print("    IsRoadTile():                  " + AIRoad.IsRoadTile(33411));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   709
	print("    GetRoadDepotFrontTile():       " + AIRoad.GetRoadDepotFrontTile(33411));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   710
	print("    IsRoadDepotTile():             " + AIRoad.IsRoadDepotTile(33411));
9769
015b6674c8ad (svn r12259) [NoAI] -Fix: depots were considered buildable (tnx Progman)
truebrain
parents: 9758
diff changeset
   711
	print("    IsBuildable():                 " + AITile.IsBuildable(33411));
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   712
	print("    RemoveRoadDepot():             " + AIRoad.RemoveRoadDepot(33411));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   713
	print("    RemoveRoadDepot():             " + AIRoad.RemoveRoadDepot(33411));
9485
df09b849ca60 (svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents: 9470
diff changeset
   714
df09b849ca60 (svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents: 9470
diff changeset
   715
	print("  Station");
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   716
	print("    IsRoadTile():                  " + AIRoad.IsRoadTile(33411));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   717
	print("    BuildRoadStation():            " + AIRoad.BuildRoadStation(0, 1, false, false));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   718
	print("    BuildRoadStation():            " + AIRoad.BuildRoadStation(33411, 33411, false, false));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   719
	print("    BuildRoadStation():            " + AIRoad.BuildRoadStation(33411, 33414, false, false));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   720
	print("    BuildRoadStation():            " + AIRoad.BuildRoadStation(33411, 33412, false, false));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   721
	print("    IsRoadTile():                  " + AIRoad.IsRoadTile(33411));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   722
	print("    GetDriveThroughBackTile():     " + AIRoad.GetDriveThroughBackTile(33411));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   723
	print("    GetRoadStationFrontTile():     " + AIRoad.GetRoadStationFrontTile(33411));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   724
	print("    IsRoadStationTile():           " + AIRoad.IsRoadStationTile(33411));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   725
	print("    IsDriveThroughRoadStationTile: " + AIRoad.IsDriveThroughRoadStationTile(33411));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   726
	print("    RemoveRoadStation():           " + AIRoad.RemoveRoadStation(33411));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   727
	print("    RemoveRoadStation():           " + AIRoad.RemoveRoadStation(33411));
9485
df09b849ca60 (svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents: 9470
diff changeset
   728
df09b849ca60 (svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents: 9470
diff changeset
   729
	print("  Station Types");
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   730
	print("    BuildRoadStation(bus):         " + AIRoad.BuildRoadStation(33411, 33410, false, false));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   731
	print("    BuildRoadStation(truck):       " + AIRoad.BuildRoadStation(33421, 33422, true,  false));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   732
	print("    BuildRoadStation(truck):       " + AIRoad.BuildRoadStation(33412, 33413, true,  false));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   733
	print("    BuildRoadStation(bus):         " + AIRoad.BuildRoadStation(33411 + 256, 33411, false, false));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   734
	print("    BuildRoadStation(truck):       " + AIRoad.BuildRoadStation(33412 + 256, 33412 + 256 + 256, true,  false));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   735
	print("    BuildRoadStation(bus-drive):   " + AIRoad.BuildRoadStation(33413, 33412, false, true));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   736
	print("    BuildRoadStation(truck-drive): " + AIRoad.BuildRoadStation(33414, 33413, true,  true));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   737
	print("    BuildRoadStation(bus-drive):   " + AIRoad.BuildRoadStation(33415, 33414, false, true));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   738
	print("    BuildRoadStation(truck-drive): " + AIRoad.BuildRoadStation(33416, 33415, true,  true));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   739
	print("    BuildRoadDepot():              " + AIRoad.BuildRoadDepot(33417, 33418));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   740
	print("    GetRoadStationFrontTile():     " + AIRoad.GetRoadStationFrontTile(33411 + 256));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   741
	print("    GetRoadStationFrontTile():     " + AIRoad.GetRoadStationFrontTile(33412 + 256));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   742
	print("    IsDriveThroughRoadStationTile: " + AIRoad.IsDriveThroughRoadStationTile(33415));
9769
015b6674c8ad (svn r12259) [NoAI] -Fix: depots were considered buildable (tnx Progman)
truebrain
parents: 9758
diff changeset
   743
	print("    IsBuildable():                 " + AITile.IsBuildable(33415));
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   744
	print("    GetDriveThroughBackTile():     " + AIRoad.GetDriveThroughBackTile(33415));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   745
	print("    GetRoadStationFrontTile():     " + AIRoad.GetRoadStationFrontTile(33415));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   746
	print("    IsRoadTile():                  " + AIRoad.IsRoadTile(33415));
9485
df09b849ca60 (svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents: 9470
diff changeset
   747
}
df09b849ca60 (svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents: 9470
diff changeset
   748
9511
f767ad06e86b (svn r9407) [NoAI] -Add: placing of signs.
rubidium
parents: 9492
diff changeset
   749
function Regression::Sign()
f767ad06e86b (svn r9407) [NoAI] -Add: placing of signs.
rubidium
parents: 9492
diff changeset
   750
{
f767ad06e86b (svn r9407) [NoAI] -Add: placing of signs.
rubidium
parents: 9492
diff changeset
   751
	local j = 0;
f767ad06e86b (svn r9407) [NoAI] -Add: placing of signs.
rubidium
parents: 9492
diff changeset
   752
f767ad06e86b (svn r9407) [NoAI] -Add: placing of signs.
rubidium
parents: 9492
diff changeset
   753
	print("");
f767ad06e86b (svn r9407) [NoAI] -Add: placing of signs.
rubidium
parents: 9492
diff changeset
   754
	print("--Sign--");
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   755
	print("  BuildSign(33410, 'Some Sign'):       " + AISign.BuildSign(33410, "Some Sign"));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   756
	local AISign_id = AISign.BuildSign(33409, "Some other Sign");
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   757
	print("  BuildSign(33409, 'Some other Sign'): " + AISign_id);
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   758
	print("  RemoveSign(" + AISign_id + "):                       " + AISign.RemoveSign(AISign_id));
9511
f767ad06e86b (svn r9407) [NoAI] -Add: placing of signs.
rubidium
parents: 9492
diff changeset
   759
	print("");
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   760
	print("  GetMaxSignID():    " + AISign.GetMaxSignID());
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   761
	print("  GetSignCount():    " + AISign.GetSignCount());
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   762
	for (local i = -1; i < AISign.GetMaxSignID() + 1; i++) {
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   763
		if (AISign.IsValidSign(i)) j++;
9511
f767ad06e86b (svn r9407) [NoAI] -Add: placing of signs.
rubidium
parents: 9492
diff changeset
   764
		print("  Sign " + i);
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   765
		print("    IsValidSign():   " + AISign.IsValidSign(i));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   766
		print("    GetText():       " + AISign.GetText(i));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   767
		print("    GetLocation():   " + AISign.GetLocation(i));
9511
f767ad06e86b (svn r9407) [NoAI] -Add: placing of signs.
rubidium
parents: 9492
diff changeset
   768
	}
f767ad06e86b (svn r9407) [NoAI] -Add: placing of signs.
rubidium
parents: 9492
diff changeset
   769
	print("  Valid Signs:       " + j);
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   770
	print("  GetSignCount():    " + AISign.GetSignCount());
9511
f767ad06e86b (svn r9407) [NoAI] -Add: placing of signs.
rubidium
parents: 9492
diff changeset
   771
}
f767ad06e86b (svn r9407) [NoAI] -Add: placing of signs.
rubidium
parents: 9492
diff changeset
   772
9638
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents: 9636
diff changeset
   773
function Regression::Station()
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents: 9636
diff changeset
   774
{
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents: 9636
diff changeset
   775
	print("");
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents: 9636
diff changeset
   776
	print("--Station--");
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   777
	print("  IsValidStation(0):        " + AIStation.IsValidStation(0));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   778
	print("  IsValidStation(1000):     " + AIStation.IsValidStation(1000));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   779
	print("  GetName(0):               " + AIStation.GetName(0));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   780
	print("  GetLocation(1):           " + AIStation.GetLocation(1));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   781
	print("  GetLocation(1000):        " + AIStation.GetLocation(1000));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   782
	print("  GetStationID(33411):      " + AIStation.GetStationID(33411));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   783
	print("  GetStationID(34411):      " + AIStation.GetStationID(34411));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   784
	print("  GetCargoWaiting(0, 0):    " + AIStation.GetCargoWaiting(0, 0));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   785
	print("  GetCargoWaiting(1000, 0): " + AIStation.GetCargoWaiting(1000, 0));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   786
	print("  GetCargoWaiting(0, 1000): " + AIStation.GetCargoWaiting(0, 1000));
9638
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents: 9636
diff changeset
   787
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   788
	print("  GetCoverageRadius(bus):   " + AIStation.GetCoverageRadius(AIStation.STATION_BUS_STOP));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   789
	print("  GetCoverageRadius(truck): " + AIStation.GetCoverageRadius(AIStation.STATION_TRUCK_STOP));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   790
	print("  GetCoverageRadius(train): " + AIStation.GetCoverageRadius(AIStation.STATION_TRAIN));
9670
820b77e19bb3 (svn r10609) [NoAI] -Add: added GetAirportWidth / GetAirportHeight
truelight
parents: 9668
diff changeset
   791
820b77e19bb3 (svn r10609) [NoAI] -Add: added GetAirportWidth / GetAirportHeight
truelight
parents: 9668
diff changeset
   792
	local list = AIStationList(AIStation.STATION_BUS_STOP + AIStation.STATION_TRUCK_STOP);
9638
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents: 9636
diff changeset
   793
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents: 9636
diff changeset
   794
	print("");
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents: 9636
diff changeset
   795
	print("--StationList--");
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents: 9636
diff changeset
   796
	print("  Count():             " + list.Count());
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   797
	list.Valuate(AIStation.GetLocation);
9638
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents: 9636
diff changeset
   798
	print("  Location ListDump:");
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents: 9636
diff changeset
   799
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents: 9636
diff changeset
   800
		print("    " + i + " => " + list.GetValue(i));
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents: 9636
diff changeset
   801
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   802
	list.Valuate(AIStation.GetCargoWaiting, 0);
9638
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents: 9636
diff changeset
   803
	print("  CargoWaiting(0) ListDump:");
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents: 9636
diff changeset
   804
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents: 9636
diff changeset
   805
		print("    " + i + " => " + list.GetValue(i));
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents: 9636
diff changeset
   806
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   807
	list.Valuate(AIStation.GetCargoWaiting, 1);
9638
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents: 9636
diff changeset
   808
	print("  CargoWaiting(1) ListDump:");
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents: 9636
diff changeset
   809
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents: 9636
diff changeset
   810
		print("    " + i + " => " + list.GetValue(i));
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents: 9636
diff changeset
   811
	}
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents: 9636
diff changeset
   812
}
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents: 9636
diff changeset
   813
9592
c5c09cfde63a (svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents: 9589
diff changeset
   814
function Regression::TileList()
c5c09cfde63a (svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents: 9589
diff changeset
   815
{
c5c09cfde63a (svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents: 9589
diff changeset
   816
	local list = AITileList();
c5c09cfde63a (svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents: 9589
diff changeset
   817
c5c09cfde63a (svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents: 9589
diff changeset
   818
	print("");
c5c09cfde63a (svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents: 9589
diff changeset
   819
	print("--TileList--");
c5c09cfde63a (svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents: 9589
diff changeset
   820
	print("  Count():             " + list.Count());
10191
da75d1460a4b (svn r12722) [NoAI] -Add (or -Feature for yorick): added AITile::IsSteepSlope(), AITile::IsHalftileSlope() and AITile::GetComplementSlope()
truebrain
parents: 10187
diff changeset
   821
	list.AddRectangle(27631 - 256 * 1, 256 * 1 + 27631 + 2);
da75d1460a4b (svn r12722) [NoAI] -Add (or -Feature for yorick): added AITile::IsSteepSlope(), AITile::IsHalftileSlope() and AITile::GetComplementSlope()
truebrain
parents: 10187
diff changeset
   822
	print("  Count():             " + list.Count());
da75d1460a4b (svn r12722) [NoAI] -Add (or -Feature for yorick): added AITile::IsSteepSlope(), AITile::IsHalftileSlope() and AITile::GetComplementSlope()
truebrain
parents: 10187
diff changeset
   823
da75d1460a4b (svn r12722) [NoAI] -Add (or -Feature for yorick): added AITile::IsSteepSlope(), AITile::IsHalftileSlope() and AITile::GetComplementSlope()
truebrain
parents: 10187
diff changeset
   824
	list.Valuate(AITile.GetSlope);
da75d1460a4b (svn r12722) [NoAI] -Add (or -Feature for yorick): added AITile::IsSteepSlope(), AITile::IsHalftileSlope() and AITile::GetComplementSlope()
truebrain
parents: 10187
diff changeset
   825
	print("  Slope():             done");
da75d1460a4b (svn r12722) [NoAI] -Add (or -Feature for yorick): added AITile::IsSteepSlope(), AITile::IsHalftileSlope() and AITile::GetComplementSlope()
truebrain
parents: 10187
diff changeset
   826
	print("  Count():             " + list.Count());
da75d1460a4b (svn r12722) [NoAI] -Add (or -Feature for yorick): added AITile::IsSteepSlope(), AITile::IsHalftileSlope() and AITile::GetComplementSlope()
truebrain
parents: 10187
diff changeset
   827
	print("  ListDump:");
da75d1460a4b (svn r12722) [NoAI] -Add (or -Feature for yorick): added AITile::IsSteepSlope(), AITile::IsHalftileSlope() and AITile::GetComplementSlope()
truebrain
parents: 10187
diff changeset
   828
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
da75d1460a4b (svn r12722) [NoAI] -Add (or -Feature for yorick): added AITile::IsSteepSlope(), AITile::IsHalftileSlope() and AITile::GetComplementSlope()
truebrain
parents: 10187
diff changeset
   829
		print("    " + i + " => " + list.GetValue(i));
da75d1460a4b (svn r12722) [NoAI] -Add (or -Feature for yorick): added AITile::IsSteepSlope(), AITile::IsHalftileSlope() and AITile::GetComplementSlope()
truebrain
parents: 10187
diff changeset
   830
		print("    " + i + " => " + AITile.GetComplementSlope(list.GetValue(i)));
da75d1460a4b (svn r12722) [NoAI] -Add (or -Feature for yorick): added AITile::IsSteepSlope(), AITile::IsHalftileSlope() and AITile::GetComplementSlope()
truebrain
parents: 10187
diff changeset
   831
		print("    " + i + " => " + AITile.IsSteepSlope(list.GetValue(i)));
da75d1460a4b (svn r12722) [NoAI] -Add (or -Feature for yorick): added AITile::IsSteepSlope(), AITile::IsHalftileSlope() and AITile::GetComplementSlope()
truebrain
parents: 10187
diff changeset
   832
		print("    " + i + " => " + AITile.IsHalftileSlope(list.GetValue(i)));
da75d1460a4b (svn r12722) [NoAI] -Add (or -Feature for yorick): added AITile::IsSteepSlope(), AITile::IsHalftileSlope() and AITile::GetComplementSlope()
truebrain
parents: 10187
diff changeset
   833
	}
da75d1460a4b (svn r12722) [NoAI] -Add (or -Feature for yorick): added AITile::IsSteepSlope(), AITile::IsHalftileSlope() and AITile::GetComplementSlope()
truebrain
parents: 10187
diff changeset
   834
	list.Clear();
da75d1460a4b (svn r12722) [NoAI] -Add (or -Feature for yorick): added AITile::IsSteepSlope(), AITile::IsHalftileSlope() and AITile::GetComplementSlope()
truebrain
parents: 10187
diff changeset
   835
da75d1460a4b (svn r12722) [NoAI] -Add (or -Feature for yorick): added AITile::IsSteepSlope(), AITile::IsHalftileSlope() and AITile::GetComplementSlope()
truebrain
parents: 10187
diff changeset
   836
	print("");
da75d1460a4b (svn r12722) [NoAI] -Add (or -Feature for yorick): added AITile::IsSteepSlope(), AITile::IsHalftileSlope() and AITile::GetComplementSlope()
truebrain
parents: 10187
diff changeset
   837
	print("--TileList--");
da75d1460a4b (svn r12722) [NoAI] -Add (or -Feature for yorick): added AITile::IsSteepSlope(), AITile::IsHalftileSlope() and AITile::GetComplementSlope()
truebrain
parents: 10187
diff changeset
   838
	print("  Count():             " + list.Count());
9605
2c2348827b52 (svn r9749) [NoAI] -Add: added regression-test for new AITileList valuators
truelight
parents: 9592
diff changeset
   839
	list.AddRectangle(41895 - 256 * 2, 256 * 2 + 41895 + 8);
9592
c5c09cfde63a (svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents: 9589
diff changeset
   840
	print("  Count():             " + list.Count());
9609
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9605
diff changeset
   841
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   842
	list.Valuate(AITile.GetHeight);
9700
e442ce398e83 (svn r10941) [NoAI] -Add: added AITile::GetHeight and AITileList valuator Height
truelight
parents: 9699
diff changeset
   843
	print("  Height():            done");
e442ce398e83 (svn r10941) [NoAI] -Add: added AITile::GetHeight and AITileList valuator Height
truelight
parents: 9699
diff changeset
   844
	print("  Count():             " + list.Count());
e442ce398e83 (svn r10941) [NoAI] -Add: added AITile::GetHeight and AITileList valuator Height
truelight
parents: 9699
diff changeset
   845
	print("  ListDump:");
e442ce398e83 (svn r10941) [NoAI] -Add: added AITile::GetHeight and AITileList valuator Height
truelight
parents: 9699
diff changeset
   846
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
e442ce398e83 (svn r10941) [NoAI] -Add: added AITile::GetHeight and AITileList valuator Height
truelight
parents: 9699
diff changeset
   847
		print("    " + i + " => " + list.GetValue(i));
e442ce398e83 (svn r10941) [NoAI] -Add: added AITile::GetHeight and AITileList valuator Height
truelight
parents: 9699
diff changeset
   848
	}
e442ce398e83 (svn r10941) [NoAI] -Add: added AITile::GetHeight and AITileList valuator Height
truelight
parents: 9699
diff changeset
   849
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   850
	list.Valuate(AITile.GetSlope);
9611
5cf58c6571b7 (svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents: 9609
diff changeset
   851
	list.KeepValue(0);
5cf58c6571b7 (svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents: 9609
diff changeset
   852
	print("  Slope():             done");
5cf58c6571b7 (svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents: 9609
diff changeset
   853
	print("  KeepValue(0):        done");
5cf58c6571b7 (svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents: 9609
diff changeset
   854
	print("  Count():             " + list.Count());
5cf58c6571b7 (svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents: 9609
diff changeset
   855
	print("  ListDump:");
5cf58c6571b7 (svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents: 9609
diff changeset
   856
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
5cf58c6571b7 (svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents: 9609
diff changeset
   857
		print("    " + i + " => " + list.GetValue(i));
5cf58c6571b7 (svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents: 9609
diff changeset
   858
	}
5cf58c6571b7 (svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents: 9609
diff changeset
   859
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   860
	list.Valuate(AITile.IsBuildable);
9592
c5c09cfde63a (svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents: 9589
diff changeset
   861
	list.KeepValue(1);
9605
2c2348827b52 (svn r9749) [NoAI] -Add: added regression-test for new AITileList valuators
truelight
parents: 9592
diff changeset
   862
	print("  Buildable():         done");
9609
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9605
diff changeset
   863
	print("  KeepValue(1):        done");
9605
2c2348827b52 (svn r9749) [NoAI] -Add: added regression-test for new AITileList valuators
truelight
parents: 9592
diff changeset
   864
	print("  Count():             " + list.Count());
9609
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9605
diff changeset
   865
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   866
	list.Valuate(AITile.IsBuildableRectangle, 3, 3);
9657
f2c6e332d8bc (svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents: 9655
diff changeset
   867
	print("  BuildableRectangle(3, 3) ListDump:");
f2c6e332d8bc (svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents: 9655
diff changeset
   868
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
f2c6e332d8bc (svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents: 9655
diff changeset
   869
		print("    " + i + " => " + list.GetValue(i));
f2c6e332d8bc (svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents: 9655
diff changeset
   870
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   871
	list.Valuate(AITile.GetDistanceManhattanToTile, 30000);
9655
e8e43f333832 (svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents: 9654
diff changeset
   872
	print("  DistanceManhattanToTile(30000) ListDump:");
e8e43f333832 (svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents: 9654
diff changeset
   873
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
e8e43f333832 (svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents: 9654
diff changeset
   874
		print("    " + i + " => " + list.GetValue(i));
e8e43f333832 (svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents: 9654
diff changeset
   875
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   876
	list.Valuate(AITile.GetDistanceSquareToTile, 30000);
9655
e8e43f333832 (svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents: 9654
diff changeset
   877
	print("  DistanceSquareToTile(30000) ListDump:");
e8e43f333832 (svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents: 9654
diff changeset
   878
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
e8e43f333832 (svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents: 9654
diff changeset
   879
		print("    " + i + " => " + list.GetValue(i));
e8e43f333832 (svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents: 9654
diff changeset
   880
	}
e8e43f333832 (svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents: 9654
diff changeset
   881
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   882
	list.Valuate(AITile.GetCargoAcceptance, 0, 1, 1, 3);
9609
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9605
diff changeset
   883
	list.KeepAboveValue(10);
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9605
diff changeset
   884
	print("  CargoAcceptance():   done");
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9605
diff changeset
   885
	print("  KeepAboveValue(10):  done");
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9605
diff changeset
   886
	print("  Count():             " + list.Count());
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9605
diff changeset
   887
	print("  ListDump:");
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9605
diff changeset
   888
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9605
diff changeset
   889
		print("    " + i + " => " + list.GetValue(i));
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9605
diff changeset
   890
	}
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9605
diff changeset
   891
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   892
	list.Valuate(AIRoad.IsRoadTile);
9605
2c2348827b52 (svn r9749) [NoAI] -Add: added regression-test for new AITileList valuators
truelight
parents: 9592
diff changeset
   893
	list.KeepValue(1);
2c2348827b52 (svn r9749) [NoAI] -Add: added regression-test for new AITileList valuators
truelight
parents: 9592
diff changeset
   894
	print("  RoadTile():          done");
9609
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9605
diff changeset
   895
	print("  KeepValue(1):        done");
9605
2c2348827b52 (svn r9749) [NoAI] -Add: added regression-test for new AITileList valuators
truelight
parents: 9592
diff changeset
   896
	print("  Count():             " + list.Count());
9609
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9605
diff changeset
   897
	print("  ListDump:");
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9605
diff changeset
   898
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9605
diff changeset
   899
		print("    " + i + " => " + list.GetValue(i));
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9605
diff changeset
   900
	}
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9605
diff changeset
   901
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   902
	list.Valuate(AIRoad.GetNeighbourRoadCount);
9605
2c2348827b52 (svn r9749) [NoAI] -Add: added regression-test for new AITileList valuators
truelight
parents: 9592
diff changeset
   903
	list.KeepValue(1);
9617
df9cedf12aab (svn r9786) [NoAI] -Fix: NeighbourRoad -> NeighbourRoadCount
truelight
parents: 9616
diff changeset
   904
	print("  NeighbourRoadCount():done");
9609
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9605
diff changeset
   905
	print("  KeepValue(1):        done");
9592
c5c09cfde63a (svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents: 9589
diff changeset
   906
	print("  Count():             " + list.Count());
c5c09cfde63a (svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents: 9589
diff changeset
   907
	print("  ListDump:");
c5c09cfde63a (svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents: 9589
diff changeset
   908
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
c5c09cfde63a (svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents: 9589
diff changeset
   909
		print("    " + i + " => " + list.GetValue(i));
c5c09cfde63a (svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents: 9589
diff changeset
   910
	}
9698
1d50fe99b7e9 (svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents: 9696
diff changeset
   911
1d50fe99b7e9 (svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents: 9696
diff changeset
   912
	list.AddRectangle(54421 - 256 * 2, 256 * 2 + 54421 + 8);
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   913
	list.Valuate(AITile.IsWater);
9698
1d50fe99b7e9 (svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents: 9696
diff changeset
   914
	print("  Water():             done");
1d50fe99b7e9 (svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents: 9696
diff changeset
   915
	print("  Count():             " + list.Count());
1d50fe99b7e9 (svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents: 9696
diff changeset
   916
	print("  ListDump:");
1d50fe99b7e9 (svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents: 9696
diff changeset
   917
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
1d50fe99b7e9 (svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents: 9696
diff changeset
   918
		print("    " + i + " => " + list.GetValue(i));
1d50fe99b7e9 (svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents: 9696
diff changeset
   919
	}
9758
f01f3df7cfbe (svn r12243) [NoAI] -Fix r12242: move the regression-test for AITileList_Industry* to TileList(), and show that they really work by using the Valuators to proof that
truebrain
parents: 9757
diff changeset
   920
f01f3df7cfbe (svn r12243) [NoAI] -Fix r12242: move the regression-test for AITileList_Industry* to TileList(), and show that they really work by using the Valuators to proof that
truebrain
parents: 9757
diff changeset
   921
	local list = AITileList_IndustryAccepting(0, 3);
f01f3df7cfbe (svn r12243) [NoAI] -Fix r12242: move the regression-test for AITileList_Industry* to TileList(), and show that they really work by using the Valuators to proof that
truebrain
parents: 9757
diff changeset
   922
	print("");
f01f3df7cfbe (svn r12243) [NoAI] -Fix r12242: move the regression-test for AITileList_Industry* to TileList(), and show that they really work by using the Valuators to proof that
truebrain
parents: 9757
diff changeset
   923
	print("--TileList_IndustryAccepting--");
f01f3df7cfbe (svn r12243) [NoAI] -Fix r12242: move the regression-test for AITileList_Industry* to TileList(), and show that they really work by using the Valuators to proof that
truebrain
parents: 9757
diff changeset
   924
	print("  Count():             " + list.Count());
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   925
	list.Valuate(AITile.GetCargoAcceptance, 3, 1, 1, 3);
9758
f01f3df7cfbe (svn r12243) [NoAI] -Fix r12242: move the regression-test for AITileList_Industry* to TileList(), and show that they really work by using the Valuators to proof that
truebrain
parents: 9757
diff changeset
   926
	print("  Location ListDump:");
f01f3df7cfbe (svn r12243) [NoAI] -Fix r12242: move the regression-test for AITileList_Industry* to TileList(), and show that they really work by using the Valuators to proof that
truebrain
parents: 9757
diff changeset
   927
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
f01f3df7cfbe (svn r12243) [NoAI] -Fix r12242: move the regression-test for AITileList_Industry* to TileList(), and show that they really work by using the Valuators to proof that
truebrain
parents: 9757
diff changeset
   928
		print("    " + i + " => " + list.GetValue(i));
f01f3df7cfbe (svn r12243) [NoAI] -Fix r12242: move the regression-test for AITileList_Industry* to TileList(), and show that they really work by using the Valuators to proof that
truebrain
parents: 9757
diff changeset
   929
	}
f01f3df7cfbe (svn r12243) [NoAI] -Fix r12242: move the regression-test for AITileList_Industry* to TileList(), and show that they really work by using the Valuators to proof that
truebrain
parents: 9757
diff changeset
   930
f01f3df7cfbe (svn r12243) [NoAI] -Fix r12242: move the regression-test for AITileList_Industry* to TileList(), and show that they really work by using the Valuators to proof that
truebrain
parents: 9757
diff changeset
   931
	local list = AITileList_IndustryProducing(1, 3);
f01f3df7cfbe (svn r12243) [NoAI] -Fix r12242: move the regression-test for AITileList_Industry* to TileList(), and show that they really work by using the Valuators to proof that
truebrain
parents: 9757
diff changeset
   932
	print("");
f01f3df7cfbe (svn r12243) [NoAI] -Fix r12242: move the regression-test for AITileList_Industry* to TileList(), and show that they really work by using the Valuators to proof that
truebrain
parents: 9757
diff changeset
   933
	print("--TileList_IndustryProducing--");
f01f3df7cfbe (svn r12243) [NoAI] -Fix r12242: move the regression-test for AITileList_Industry* to TileList(), and show that they really work by using the Valuators to proof that
truebrain
parents: 9757
diff changeset
   934
	print("  Count():             " + list.Count());
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   935
	list.Valuate(AITile.GetCargoProduction, 7, 1, 1, 3);
9758
f01f3df7cfbe (svn r12243) [NoAI] -Fix r12242: move the regression-test for AITileList_Industry* to TileList(), and show that they really work by using the Valuators to proof that
truebrain
parents: 9757
diff changeset
   936
	print("  Location ListDump:");
f01f3df7cfbe (svn r12243) [NoAI] -Fix r12242: move the regression-test for AITileList_Industry* to TileList(), and show that they really work by using the Valuators to proof that
truebrain
parents: 9757
diff changeset
   937
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
f01f3df7cfbe (svn r12243) [NoAI] -Fix r12242: move the regression-test for AITileList_Industry* to TileList(), and show that they really work by using the Valuators to proof that
truebrain
parents: 9757
diff changeset
   938
		print("    " + i + " => " + list.GetValue(i));
f01f3df7cfbe (svn r12243) [NoAI] -Fix r12242: move the regression-test for AITileList_Industry* to TileList(), and show that they really work by using the Valuators to proof that
truebrain
parents: 9757
diff changeset
   939
	}
9592
c5c09cfde63a (svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents: 9589
diff changeset
   940
}
c5c09cfde63a (svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents: 9589
diff changeset
   941
9460
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
   942
function Regression::Town()
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
   943
{
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
   944
	local j = 0;
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
   945
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
   946
	print("");
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
   947
	print("--Town--");
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   948
	print("  GetMaxTownID():    " + AITown.GetMaxTownID());
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   949
	print("  GetTownCount():    " + AITown.GetTownCount());
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   950
	for (local i = -1; i < AITown.GetMaxTownID() + 1; i++) {
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   951
		if (AITown.IsValidTown(i)) j++;
9460
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
   952
		print("  Town " + i);
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   953
		print("    IsValidTown():   " + AITown.IsValidTown(i));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   954
		print("    GetName():       " + AITown.GetName(i));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   955
		print("    GetPopulation(): " + AITown.GetPopulation(i));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   956
		print("    GetLocation():   " + AITown.GetLocation(i));
9460
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
   957
	}
9511
f767ad06e86b (svn r9407) [NoAI] -Add: placing of signs.
rubidium
parents: 9492
diff changeset
   958
	print("  Valid Towns:       " + j);
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
   959
	print("  GetTownCount():    " + AITown.GetTownCount());
9460
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
   960
}
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
   961
9589
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents: 9585
diff changeset
   962
function Regression::TownList()
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents: 9585
diff changeset
   963
{
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents: 9585
diff changeset
   964
	local list = AITownList();
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents: 9585
diff changeset
   965
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents: 9585
diff changeset
   966
	print("");
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents: 9585
diff changeset
   967
	print("--TownList--");
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents: 9585
diff changeset
   968
	print("  Count():             " + list.Count());
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   969
	list.Valuate(AITown.GetLocation);
9649
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
   970
	print("  Location ListDump:");
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
   971
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
   972
		print("    " + i + " => " + list.GetValue(i));
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
   973
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   974
	list.Valuate(AITown.GetDistanceManhattanToTile, 30000);
9655
e8e43f333832 (svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents: 9654
diff changeset
   975
	print("  DistanceManhattanToTile(30000) ListDump:");
e8e43f333832 (svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents: 9654
diff changeset
   976
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
e8e43f333832 (svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents: 9654
diff changeset
   977
		print("    " + i + " => " + list.GetValue(i));
e8e43f333832 (svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents: 9654
diff changeset
   978
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   979
	list.Valuate(AITown.GetDistanceSquareToTile, 30000);
9655
e8e43f333832 (svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents: 9654
diff changeset
   980
	print("  DistanceSquareToTile(30000) ListDump:");
e8e43f333832 (svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents: 9654
diff changeset
   981
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
e8e43f333832 (svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents: 9654
diff changeset
   982
		print("    " + i + " => " + list.GetValue(i));
e8e43f333832 (svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents: 9654
diff changeset
   983
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   984
	list.Valuate(AITown.GetPopulation);
9589
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents: 9585
diff changeset
   985
	list.KeepAboveValue(500);
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents: 9585
diff changeset
   986
	print("  KeepAboveValue(500): done");
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents: 9585
diff changeset
   987
	print("  Count():             " + list.Count());
9649
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
   988
	print("  Population ListDump:");
9589
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents: 9585
diff changeset
   989
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents: 9585
diff changeset
   990
		print("    " + i + " => " + list.GetValue(i));
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents: 9585
diff changeset
   991
	}
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents: 9585
diff changeset
   992
}
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents: 9585
diff changeset
   993
9794
5d866d7cb991 (svn r12298) [NoAI] -Add: added AITunnel (Morloth)
truebrain
parents: 9793
diff changeset
   994
function Regression::Tunnel()
5d866d7cb991 (svn r12298) [NoAI] -Add: added AITunnel (Morloth)
truebrain
parents: 9793
diff changeset
   995
{
5d866d7cb991 (svn r12298) [NoAI] -Add: added AITunnel (Morloth)
truebrain
parents: 9793
diff changeset
   996
	print("  IsTunnelTile():       " + AITunnel.IsTunnelTile(29050));
5d866d7cb991 (svn r12298) [NoAI] -Add: added AITunnel (Morloth)
truebrain
parents: 9793
diff changeset
   997
	print("  RemoveTunnel():       " + AITunnel.RemoveTunnel(29050));
9807
5b3be41b3ce6 (svn r12315) [NoAI] -Fix: AITunnel::GetOtherTunnelEnd() now also works to estimate where a non-existing tunnel would end (Morloth / glx)
truebrain
parents: 9806
diff changeset
   998
	print("  GetOtherTunnelEnd():  " + AITunnel.GetOtherTunnelEnd(29050));
9794
5d866d7cb991 (svn r12298) [NoAI] -Add: added AITunnel (Morloth)
truebrain
parents: 9793
diff changeset
   999
	print("  BuildTunnel():        " + AITunnel.BuildTunnel(AIVehicle.VEHICLE_ROAD, 29050));
9807
5b3be41b3ce6 (svn r12315) [NoAI] -Fix: AITunnel::GetOtherTunnelEnd() now also works to estimate where a non-existing tunnel would end (Morloth / glx)
truebrain
parents: 9806
diff changeset
  1000
	print("  GetOtherTunnelEnd():  " + AITunnel.GetOtherTunnelEnd(29050));
9794
5d866d7cb991 (svn r12298) [NoAI] -Add: added AITunnel (Morloth)
truebrain
parents: 9793
diff changeset
  1001
	print("  IsTunnelTile():       " + AITunnel.IsTunnelTile(29050));
9807
5b3be41b3ce6 (svn r12315) [NoAI] -Fix: AITunnel::GetOtherTunnelEnd() now also works to estimate where a non-existing tunnel would end (Morloth / glx)
truebrain
parents: 9806
diff changeset
  1002
	print("  IsTunnelTile():       " + AITunnel.IsTunnelTile(28026));
9794
5d866d7cb991 (svn r12298) [NoAI] -Add: added AITunnel (Morloth)
truebrain
parents: 9793
diff changeset
  1003
	print("  RemoveTunnel():       " + AITunnel.RemoveTunnel(29050));
5d866d7cb991 (svn r12298) [NoAI] -Add: added AITunnel (Morloth)
truebrain
parents: 9793
diff changeset
  1004
	print("  IsTunnelTile():       " + AITunnel.IsTunnelTile(29050));
10088
922c6e6a8d3e (svn r12612) [NoAI] -Add: support for GetLastError for AITunnel. Patch by Morloth.
rubidium
parents: 10086
diff changeset
  1005
922c6e6a8d3e (svn r12612) [NoAI] -Add: support for GetLastError for AITunnel. Patch by Morloth.
rubidium
parents: 10086
diff changeset
  1006
	print("  --Errors--");
922c6e6a8d3e (svn r12612) [NoAI] -Add: support for GetLastError for AITunnel. Patch by Morloth.
rubidium
parents: 10086
diff changeset
  1007
	print("  BuildTunnel():        " + AITunnel.BuildTunnel(AIVehicle.VEHICLE_ROAD, 7529));
922c6e6a8d3e (svn r12612) [NoAI] -Add: support for GetLastError for AITunnel. Patch by Morloth.
rubidium
parents: 10086
diff changeset
  1008
	print("  BuildTunnel():        " + AITunnel.BuildTunnel(AIVehicle.VEHICLE_ROAD, 8043));
922c6e6a8d3e (svn r12612) [NoAI] -Add: support for GetLastError for AITunnel. Patch by Morloth.
rubidium
parents: 10086
diff changeset
  1009
	print("  GetLastErrorString(): " + AIError.GetLastErrorString());
922c6e6a8d3e (svn r12612) [NoAI] -Add: support for GetLastError for AITunnel. Patch by Morloth.
rubidium
parents: 10086
diff changeset
  1010
	print("  RemoveTunnel():       " + AITunnel.RemoveTunnel(7529));
9794
5d866d7cb991 (svn r12298) [NoAI] -Add: added AITunnel (Morloth)
truebrain
parents: 9793
diff changeset
  1011
}
5d866d7cb991 (svn r12298) [NoAI] -Add: added AITunnel (Morloth)
truebrain
parents: 9793
diff changeset
  1012
9518
b32191854ad9 (svn r9432) [NoAI] -Add: added regression-test for AIVehicle()
truelight
parents: 9511
diff changeset
  1013
function Regression::Vehicle()
b32191854ad9 (svn r9432) [NoAI] -Add: added regression-test for AIVehicle()
truelight
parents: 9511
diff changeset
  1014
{
9557
a3e1a25cf3d3 (svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents: 9555
diff changeset
  1015
	local accounting = AIAccounting();
9518
b32191854ad9 (svn r9432) [NoAI] -Add: added regression-test for AIVehicle()
truelight
parents: 9511
diff changeset
  1016
b32191854ad9 (svn r9432) [NoAI] -Add: added regression-test for AIVehicle()
truelight
parents: 9511
diff changeset
  1017
	print("");
b32191854ad9 (svn r9432) [NoAI] -Add: added regression-test for AIVehicle()
truelight
parents: 9511
diff changeset
  1018
	print("--Vehicle--");
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1019
	print("  IsValidVehicle(-1):   " + AIVehicle.IsValidVehicle(-1));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1020
	print("  IsValidVehicle(0):    " + AIVehicle.IsValidVehicle(0));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1021
	print("  IsValidVehicle(11):   " + AIVehicle.IsValidVehicle(11));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1022
	print("  ISValidVehicle(9999): " + AIVehicle.IsValidVehicle(9999));
9518
b32191854ad9 (svn r9432) [NoAI] -Add: added regression-test for AIVehicle()
truelight
parents: 9511
diff changeset
  1023
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1024
	local bank = AICompany.GetBankBalance(AICompany.MY_COMPANY);
9557
a3e1a25cf3d3 (svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents: 9555
diff changeset
  1025
9560
ff2dde050a4c (svn r9498) [NoAI] -Add: added regression for AITransactionMode()
truelight
parents: 9558
diff changeset
  1026
	{
ff2dde050a4c (svn r9498) [NoAI] -Add: added regression for AITransactionMode()
truelight
parents: 9558
diff changeset
  1027
		local transaction = AITransactionMode();
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1028
		print("  BuildVehicle():       " + AIVehicle.BuildVehicle(33417, 153));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1029
		print("  IsValidVehicle(11):   " + AIVehicle.IsValidVehicle(11));
9560
ff2dde050a4c (svn r9498) [NoAI] -Add: added regression for AITransactionMode()
truelight
parents: 9558
diff changeset
  1030
ff2dde050a4c (svn r9498) [NoAI] -Add: added regression for AITransactionMode()
truelight
parents: 9558
diff changeset
  1031
		print("  --Transaction--");
ff2dde050a4c (svn r9498) [NoAI] -Add: added regression for AITransactionMode()
truelight
parents: 9558
diff changeset
  1032
		print("    GetCosts():         " + transaction.GetCosts());
ff2dde050a4c (svn r9498) [NoAI] -Add: added regression for AITransactionMode()
truelight
parents: 9558
diff changeset
  1033
		print("    Execute():          " + transaction.Execute());
ff2dde050a4c (svn r9498) [NoAI] -Add: added regression for AITransactionMode()
truelight
parents: 9558
diff changeset
  1034
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1035
		print("  IsValidVehicle(11):   " + AIVehicle.IsValidVehicle(11));
9560
ff2dde050a4c (svn r9498) [NoAI] -Add: added regression for AITransactionMode()
truelight
parents: 9558
diff changeset
  1036
	}
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1037
	print("  CloneVehicle():       " + AIVehicle.CloneVehicle(33417, 11, true));
9557
a3e1a25cf3d3 (svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents: 9555
diff changeset
  1038
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1039
	local bank_after = AICompany.GetBankBalance(AICompany.MY_COMPANY);
9557
a3e1a25cf3d3 (svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents: 9555
diff changeset
  1040
a3e1a25cf3d3 (svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents: 9555
diff changeset
  1041
	print("  --Accounting--");
a3e1a25cf3d3 (svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents: 9555
diff changeset
  1042
	print("    GetCosts():         " + accounting.GetCosts());
a3e1a25cf3d3 (svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents: 9555
diff changeset
  1043
	print("    Should be:          " + (bank - bank_after));
a3e1a25cf3d3 (svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents: 9555
diff changeset
  1044
	print("    ResetCosts():       " + accounting.ResetCosts());
a3e1a25cf3d3 (svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents: 9555
diff changeset
  1045
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1046
	bank = AICompany.GetBankBalance(AICompany.MY_COMPANY);
9557
a3e1a25cf3d3 (svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents: 9555
diff changeset
  1047
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1048
	print("  SellVehicle(12):      " + AIVehicle.SellVehicle(12));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1049
	print("  IsInDepot():          " + AIVehicle.IsInDepot(11));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1050
	print("  IsStoppedInDepot():   " + AIVehicle.IsStoppedInDepot(11));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1051
	print("  StartStopVehicle():   " + AIVehicle.StartStopVehicle(11));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1052
	print("  IsInDepot():          " + AIVehicle.IsInDepot(11));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1053
	print("  IsStoppedInDepot():   " + AIVehicle.IsStoppedInDepot(11));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1054
	print("  SendVehicleToDepot(): " + AIVehicle.SendVehicleToDepot(11));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1055
	print("  IsInDepot():          " + AIVehicle.IsInDepot(11));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1056
	print("  IsStoppedInDepot():   " + AIVehicle.IsStoppedInDepot(11));
9557
a3e1a25cf3d3 (svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents: 9555
diff changeset
  1057
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1058
	bank_after = AICompany.GetBankBalance(AICompany.MY_COMPANY);
9557
a3e1a25cf3d3 (svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents: 9555
diff changeset
  1059
a3e1a25cf3d3 (svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents: 9555
diff changeset
  1060
	print("  --Accounting--");
a3e1a25cf3d3 (svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents: 9555
diff changeset
  1061
	print("    GetCosts():         " + accounting.GetCosts());
a3e1a25cf3d3 (svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents: 9555
diff changeset
  1062
	print("    Should be:          " + (bank - bank_after));
a3e1a25cf3d3 (svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents: 9555
diff changeset
  1063
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1064
	print("  GetName():            " + AIVehicle.GetName(11));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1065
	print("  SetName():            " + AIVehicle.SetName(11, "MyVehicleName"));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1066
	print("  GetName():            " + AIVehicle.GetName(11));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1067
	print("  CloneVehicle():       " + AIVehicle.CloneVehicle(33417, 11, true));
9614
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1068
9615
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9614
diff changeset
  1069
	print("  --VehicleData--");
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1070
	print("    GetLocation():       " + AIVehicle.GetLocation(11));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1071
	print("    GetEngineType():     " + AIVehicle.GetEngineType(11));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1072
	print("    GetUnitNumber():     " + AIVehicle.GetUnitNumber(11));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1073
	print("    GetAge():            " + AIVehicle.GetAge(11));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1074
	print("    GetMaxAge():         " + AIVehicle.GetMaxAge(11));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1075
	print("    GetAgeLeft():        " + AIVehicle.GetAgeLeft(11));
10187
d5a6eba5af45 (svn r12718) [NoAI] -Add: added AIVehicle::GetCurrentSpeed
truebrain
parents: 10088
diff changeset
  1076
	print("    GetCurrentSpeed():   " + AIVehicle.GetCurrentSpeed(11));
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1077
	print("    GetRunningCost():    " + AIVehicle.GetRunningCost(11));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1078
	print("    GetProfitThisYear(): " + AIVehicle.GetProfitThisYear(11));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1079
	print("    GetProfitLastYear(): " + AIVehicle.GetProfitLastYear(11));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1080
	print("    GetVehicleType():    " + AIVehicle.GetVehicleType(11));
10193
9f73edc0c57a (svn r12724) [NoAI] -Fix r12720: also add regression test for new functions
truebrain
parents: 10191
diff changeset
  1081
	print("    GetCapacity():       " + AIVehicle.GetCapacity(11, 10));
9f73edc0c57a (svn r12724) [NoAI] -Fix r12720: also add regression test for new functions
truebrain
parents: 10191
diff changeset
  1082
	print("    GetCargoLoad():      " + AIVehicle.GetCargoLoad(11, 10));
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1083
	print("    IsInDepot():         " + AIVehicle.IsInDepot(11));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1084
	print("    IsStoppedInDepot():  " + AIVehicle.IsStoppedInDepot(11));
9615
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9614
diff changeset
  1085
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1086
	print("  BuildVehicle():       " + AIVehicle.BuildVehicle(32119, 219));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1087
	print("  IsValidVehicle(13):   " + AIVehicle.IsValidVehicle(13));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1088
	print("  IsInDepot(13):        " + AIVehicle.IsInDepot(13));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1089
	print("  IsStoppedInDepot(13): " + AIVehicle.IsStoppedInDepot(13));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1090
	print("  IsValidVehicle(14):   " + AIVehicle.IsValidVehicle(14));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1091
	print("  IsInDepot(14):        " + AIVehicle.IsInDepot(14));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1092
	print("  IsStoppedInDepot(14): " + AIVehicle.IsStoppedInDepot(14));
9691
1231d4e5f5aa (svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents: 9684
diff changeset
  1093
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1094
	print("  BuildVehicle():       " + AIVehicle.BuildVehicle(28479, 204));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1095
	print("  IsValidVehicle(15):   " + AIVehicle.IsValidVehicle(15));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1096
	print("  IsInDepot(15):        " + AIVehicle.IsInDepot(15));
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9733
diff changeset
  1097
	print("  IsStoppedInDepot(15): " + AIVehicle.IsStoppedInDepot(15));
9654
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9652
diff changeset
  1098
9874
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9867
diff changeset
  1099
	print("  --Errors--");
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9867
diff changeset
  1100
	print("    RefitVehicle():        " + AIVehicle.RefitVehicle(11, 0));
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9867
diff changeset
  1101
	print("    GetLastErrorString():  " + AIError.GetLastErrorString());
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9867
diff changeset
  1102
	print("    SellVehicle():         " + AIVehicle.SellVehicle(11));
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9867
diff changeset
  1103
	print("    GetLastErrorString():  " + AIError.GetLastErrorString());
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9867
diff changeset
  1104
	print("    SendVehicleToDepot():  " + AIVehicle.SendVehicleToDepot(12));
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9867
diff changeset
  1105
	print("    GetLastErrorString():  " + AIError.GetLastErrorString());
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9867
diff changeset
  1106
9614
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1107
	local list = AIVehicleList();
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1108
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1109
	print("");
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1110
	print("--VehicleList--");
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1111
	print("  Count():             " + list.Count());
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
  1112
	list.Valuate(AIVehicle.GetLocation);
9614
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1113
	print("  Location ListDump:");
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1114
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1115
		print("    " + i + " => " + list.GetValue(i));
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1116
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
  1117
	list.Valuate(AIVehicle.GetEngineType);
9614
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1118
	print("  EngineType ListDump:");
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1119
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1120
		print("    " + i + " => " + list.GetValue(i));
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1121
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
  1122
	list.Valuate(AIVehicle.GetUnitNumber);
9614
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1123
	print("  UnitNumber ListDump:");
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1124
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1125
		print("    " + i + " => " + list.GetValue(i));
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1126
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
  1127
	list.Valuate(AIVehicle.GetAge);
9614
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1128
	print("  Age ListDump:");
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1129
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1130
		print("    " + i + " => " + list.GetValue(i));
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1131
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
  1132
	list.Valuate(AIVehicle.GetMaxAge);
9614
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1133
	print("  MaxAge ListDump:");
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1134
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1135
		print("    " + i + " => " + list.GetValue(i));
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1136
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
  1137
	list.Valuate(AIVehicle.GetAgeLeft);
9614
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1138
	print("  AgeLeft ListDump:");
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1139
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1140
		print("    " + i + " => " + list.GetValue(i));
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1141
	}
10187
d5a6eba5af45 (svn r12718) [NoAI] -Add: added AIVehicle::GetCurrentSpeed
truebrain
parents: 10088
diff changeset
  1142
	list.Valuate(AIVehicle.GetCurrentSpeed);
d5a6eba5af45 (svn r12718) [NoAI] -Add: added AIVehicle::GetCurrentSpeed
truebrain
parents: 10088
diff changeset
  1143
	print("  CurrentSpeed ListDump:");
d5a6eba5af45 (svn r12718) [NoAI] -Add: added AIVehicle::GetCurrentSpeed
truebrain
parents: 10088
diff changeset
  1144
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
d5a6eba5af45 (svn r12718) [NoAI] -Add: added AIVehicle::GetCurrentSpeed
truebrain
parents: 10088
diff changeset
  1145
		print("    " + i + " => " + list.GetValue(i));
d5a6eba5af45 (svn r12718) [NoAI] -Add: added AIVehicle::GetCurrentSpeed
truebrain
parents: 10088
diff changeset
  1146
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
  1147
	list.Valuate(AIVehicle.GetRunningCost);
9806
d65cc2bcb0de (svn r12312) [NoAI] -Fix: AIVehicle_vRunningCost didn't exist
truebrain
parents: 9801
diff changeset
  1148
	print("  RunningCost ListDump:");
d65cc2bcb0de (svn r12312) [NoAI] -Fix: AIVehicle_vRunningCost didn't exist
truebrain
parents: 9801
diff changeset
  1149
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
d65cc2bcb0de (svn r12312) [NoAI] -Fix: AIVehicle_vRunningCost didn't exist
truebrain
parents: 9801
diff changeset
  1150
		print("    " + i + " => " + list.GetValue(i));
d65cc2bcb0de (svn r12312) [NoAI] -Fix: AIVehicle_vRunningCost didn't exist
truebrain
parents: 9801
diff changeset
  1151
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
  1152
	list.Valuate(AIVehicle.GetProfitThisYear);
9614
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1153
	print("  ProfitThisYear ListDump:");
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1154
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1155
		print("    " + i + " => " + list.GetValue(i));
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1156
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
  1157
	list.Valuate(AIVehicle.GetProfitLastYear);
9614
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1158
	print("  ProfitLastYear ListDump:");
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1159
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1160
		print("    " + i + " => " + list.GetValue(i));
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1161
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
  1162
	list.Valuate(AIVehicle.GetVehicleType);
9684
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9682
diff changeset
  1163
	print("  VehicleType ListDump:");
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9682
diff changeset
  1164
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9682
diff changeset
  1165
		print("    " + i + " => " + list.GetValue(i));
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9682
diff changeset
  1166
	}
10193
9f73edc0c57a (svn r12724) [NoAI] -Fix r12720: also add regression test for new functions
truebrain
parents: 10191
diff changeset
  1167
	list.Valuate(AIVehicle.GetCapacity, 10);
9f73edc0c57a (svn r12724) [NoAI] -Fix r12720: also add regression test for new functions
truebrain
parents: 10191
diff changeset
  1168
	print("  VehicleType ListDump:");
9f73edc0c57a (svn r12724) [NoAI] -Fix r12720: also add regression test for new functions
truebrain
parents: 10191
diff changeset
  1169
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
9f73edc0c57a (svn r12724) [NoAI] -Fix r12720: also add regression test for new functions
truebrain
parents: 10191
diff changeset
  1170
		print("    " + i + " => " + list.GetValue(i));
9f73edc0c57a (svn r12724) [NoAI] -Fix r12720: also add regression test for new functions
truebrain
parents: 10191
diff changeset
  1171
	}
9f73edc0c57a (svn r12724) [NoAI] -Fix r12720: also add regression test for new functions
truebrain
parents: 10191
diff changeset
  1172
	list.Valuate(AIVehicle.GetCargoLoad, 10);
9f73edc0c57a (svn r12724) [NoAI] -Fix r12720: also add regression test for new functions
truebrain
parents: 10191
diff changeset
  1173
	print("  VehicleType ListDump:");
9f73edc0c57a (svn r12724) [NoAI] -Fix r12720: also add regression test for new functions
truebrain
parents: 10191
diff changeset
  1174
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
9f73edc0c57a (svn r12724) [NoAI] -Fix r12720: also add regression test for new functions
truebrain
parents: 10191
diff changeset
  1175
		print("    " + i + " => " + list.GetValue(i));
9f73edc0c57a (svn r12724) [NoAI] -Fix r12720: also add regression test for new functions
truebrain
parents: 10191
diff changeset
  1176
	}
9518
b32191854ad9 (svn r9432) [NoAI] -Add: added regression-test for AIVehicle()
truelight
parents: 9511
diff changeset
  1177
}
b32191854ad9 (svn r9432) [NoAI] -Add: added regression-test for AIVehicle()
truelight
parents: 9511
diff changeset
  1178
9460
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
  1179
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
  1180
function Regression::Start()
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
  1181
{
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
  1182
	this.TestInit();
9487
0575126e0267 (svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents: 9485
diff changeset
  1183
	this.Std();
9460
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
  1184
	this.Base();
9691
1231d4e5f5aa (svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents: 9684
diff changeset
  1185
	this.List();
9654
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9652
diff changeset
  1186
	this.Airport();
9792
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
  1187
	this.Bridge();
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
  1188
	this.BridgeList();
9460
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
  1189
	this.Cargo();
9785
edbd185e05ed (svn r12280) [NoAI] -Add: added AICargoList (Morloth)
truebrain
parents: 9776
diff changeset
  1190
	this.CargoList();
9460
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
  1191
	this.Company();
9711
c8b427215c9d (svn r11295) [NoAI] -Change [API CHANGE]: put Engine things in AIEngine, and rename functions as such. Most noticable: FindBestXXXVehicle -> FineBestXXXEngine
truelight
parents: 9710
diff changeset
  1192
	this.Engine();
9714
fdbdae7ea647 (svn r11298) [NoAI] -Add: added EngineList + Valuators for all common functions. This should replace all FindXXXEngine, which will be removed soon
truelight
parents: 9713
diff changeset
  1193
	this.EngineList();
9682
d031eb183733 (svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents: 9672
diff changeset
  1194
	this.Event();
9460
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
  1195
	this.Industry();
9649
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
  1196
	this.IndustryList();
9460
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
  1197
	this.Map();
9691
1231d4e5f5aa (svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents: 9684
diff changeset
  1198
	this.Marine();
9485
df09b849ca60 (svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents: 9470
diff changeset
  1199
	this.Road();
9511
f767ad06e86b (svn r9407) [NoAI] -Add: placing of signs.
rubidium
parents: 9492
diff changeset
  1200
	this.Sign();
9638
f6d169a5a45a (svn r10529) [NoAI] -Add: added AIStation to gather information about stations directly by Id, which is used now by AIStationList
truelight
parents: 9636
diff changeset
  1201
	this.Station();
9592
c5c09cfde63a (svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents: 9589
diff changeset
  1202
	this.TileList();
9460
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
  1203
	this.Town();
9589
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents: 9585
diff changeset
  1204
	this.TownList();
9794
5d866d7cb991 (svn r12298) [NoAI] -Add: added AITunnel (Morloth)
truebrain
parents: 9793
diff changeset
  1205
	this.Tunnel();
9518
b32191854ad9 (svn r9432) [NoAI] -Add: added regression-test for AIVehicle()
truelight
parents: 9511
diff changeset
  1206
	this.Vehicle();
9546
fde20f518285 (svn r9477) [NoAI] -Add: added regression-test for AIOrder()
truelight
parents: 9541
diff changeset
  1207
	/* Order has to be after Vehicle */
fde20f518285 (svn r9477) [NoAI] -Add: added regression-test for AIOrder()
truelight
parents: 9541
diff changeset
  1208
	this.Order();
9823
0b7f816cf46f (svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents: 9814
diff changeset
  1209
0b7f816cf46f (svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents: 9814
diff changeset
  1210
	/* Sleep now, to give time for events to happen */
0b7f816cf46f (svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents: 9814
diff changeset
  1211
	Sleep(4000);
0b7f816cf46f (svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents: 9814
diff changeset
  1212
0b7f816cf46f (svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents: 9814
diff changeset
  1213
	while (AIEventController.IsEventWaiting()) {
0b7f816cf46f (svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents: 9814
diff changeset
  1214
		local e = AIEventController.GetNextEvent();
0b7f816cf46f (svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents: 9814
diff changeset
  1215
		print("  GetNextEvent:          " + (e == null ? "null" : "instance"));
0b7f816cf46f (svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents: 9814
diff changeset
  1216
		print("    GetEventType:        " + e.GetEventType());
0b7f816cf46f (svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents: 9814
diff changeset
  1217
		switch (e.GetEventType()) {
10086
6497ef78f031 (svn r12610) [NoAI] -Fix: a subsidiary is a 'subcompany' and not the financial bonus for routes which is called a subsidy.
rubidium
parents: 9874
diff changeset
  1218
			case AIEvent.AI_ET_SUBSIDY_OFFER:
6497ef78f031 (svn r12610) [NoAI] -Fix: a subsidiary is a 'subcompany' and not the financial bonus for routes which is called a subsidy.
rubidium
parents: 9874
diff changeset
  1219
				local c = AIEventSubsidyOffer.Convert(e);
6497ef78f031 (svn r12610) [NoAI] -Fix: a subsidiary is a 'subcompany' and not the financial bonus for routes which is called a subsidy.
rubidium
parents: 9874
diff changeset
  1220
				print("      EventName:         SubsidyOffer");
9823
0b7f816cf46f (svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents: 9814
diff changeset
  1221
				print("      CargoID:           " + c.GetCargoID());
0b7f816cf46f (svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents: 9814
diff changeset
  1222
				print("      GetFromTownID:     " + c.GetFromTownID());
0b7f816cf46f (svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents: 9814
diff changeset
  1223
				print("      GetToTownID:       " + c.GetToTownID());
0b7f816cf46f (svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents: 9814
diff changeset
  1224
				print("      GetFromIndustryID: " + c.GetFromIndustryID());
0b7f816cf46f (svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents: 9814
diff changeset
  1225
				print("      GetToIndustryID:   " + c.GetToIndustryID());
0b7f816cf46f (svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents: 9814
diff changeset
  1226
				break;
0b7f816cf46f (svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents: 9814
diff changeset
  1227
0b7f816cf46f (svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents: 9814
diff changeset
  1228
			default:
0b7f816cf46f (svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents: 9814
diff changeset
  1229
				print("      Unknown Event");
0b7f816cf46f (svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents: 9814
diff changeset
  1230
				break;
0b7f816cf46f (svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents: 9814
diff changeset
  1231
		}
0b7f816cf46f (svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents: 9814
diff changeset
  1232
	}
0b7f816cf46f (svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents: 9814
diff changeset
  1233
	print("  IsEventWaiting:        false");
9460
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
  1234
}
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
  1235
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
  1236
function Regression::Stop()
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
  1237
{
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
  1238
	this.stop = true;
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
  1239
}
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
  1240
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
  1241
class FRegression extends AIFactory {
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
  1242
	function GetAuthor()      { return "OpenTTD Dev Team"; }
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
  1243
	function GetName()        { return "Regression"; }
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
  1244
	function GetDescription() { return "This runs regression-tests on all commands. On the same map the result should always be the same."; }
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
  1245
	function GetVersion()     { return 1; }
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
  1246
	function GetDate()        { return "2007-03-18"; }
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
  1247
	function CreateInstance() { return "Regression"; }
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
  1248
}
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
  1249
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
  1250
/* Only enable this if you want to run the regression test.
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
  1251
 *  The best way to do it is to disable all other AIs, so you are sure thisone
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
  1252
 *  kicks in, and use a pre-made savegame of which you already know the result.
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
  1253
 * You can compare the output from this AI with the pre-made one, and it should
b10064d51d98 (svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff changeset
  1254
 *  match. If not, something went wrong. */
9470
4593c953a276 (svn r9308) [NoAI] -Change: make the regression scripts run without any user intervention; not manual enabling and disabling of AIs
rubidium
parents: 9461
diff changeset
  1255
iFRegression <-FRegression();