bin/ai/regression/regression.nut
author truebrain
Wed, 11 Jun 2008 14:55:10 +0000
branchnoai
changeset 10918 317f736e5fc6
parent 10912 48d072a192b5
child 10931 df70e29d4c23
permissions -rw-r--r--
(svn r13470) [NoAI] -Change [Library CHANGE]: allow in graph.aystar to give a custom param to the callbacks, so you can send in an instance of yourself
10899
126faeece8b6 (svn r13450) [NoAI] -Change [API CHANGE]: renamed library category 'sets' to 'queue', as it represents more what the implementations do
truebrain
parents: 10896
diff changeset
     1
import("queue.priority_queue", "PQ", 2);
126faeece8b6 (svn r13450) [NoAI] -Change [API CHANGE]: renamed library category 'sets' to 'queue', as it represents more what the implementations do
truebrain
parents: 10896
diff changeset
     2
import("queue.binary_heap", "BH", 1);
10918
317f736e5fc6 (svn r13470) [NoAI] -Change [Library CHANGE]: allow in graph.aystar to give a custom param to the callbacks, so you can send in an instance of yourself
truebrain
parents: 10912
diff changeset
     3
import("graph.aystar", "AS", 3);
10889
ecb77cfc4a10 (svn r13440) [NoAI] -Add: introducing ai/library, a method to load libraries into your AI.
truebrain
parents: 10871
diff changeset
     4
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
     5
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
     6
	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
     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
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
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
    12
{
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("");
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("--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
    15
	print(" TickTest: " + this.GetTick());
9557
a3e1a25cf3d3 (svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents: 9555
diff changeset
    16
	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
    17
	print(" TickTest: " + this.GetTick());
9749
ee414c031e73 (svn r12229) [NoAI] -Fix: AISetting()s functions can be static too
truebrain
parents: 9745
diff changeset
    18
	print(" SetCommandDelay: " + AISettings.SetCommandDelay(1));
10852
f02afc46afa8 (svn r13403) [NoAI] -Add: wrapper to read the game settings directly without *any* promises on the results being stable in the future when OpenTTD changes the semantics.
rubidium
parents: 10847
diff changeset
    19
	print(" IsValid(vehicle.plane_speed): " + AIGameSettings.IsValid("vehicle.plane_speed"));
f02afc46afa8 (svn r13403) [NoAI] -Add: wrapper to read the game settings directly without *any* promises on the results being stable in the future when OpenTTD changes the semantics.
rubidium
parents: 10847
diff changeset
    20
	print(" vehicle.plane_speed: " + AIGameSettings.GetValue("vehicle.plane_speed"));
10649
9034b80fdbdb (svn r13193) [NoAI] -Add: allow AIs to be packed in a .tar. one AI per tar, always in a subdir. It looks for main.nut in the first dir it finds in the archive
truebrain
parents: 10383
diff changeset
    21
	require("require.nut");
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
    22
}
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
    23
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
    24
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
    25
{
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
	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
    27
	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
    28
	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
    29
	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
    30
}
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
    31
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
    32
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
    33
{
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
    34
	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
    35
	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
    36
	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
    37
	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
    38
	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
    39
	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
    40
	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
    41
	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
    42
	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
    43
	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
    44
	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
    45
	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
    46
	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
    47
	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
    48
	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
    49
	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
    50
	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
    51
	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
    52
	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
    53
	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
    54
}
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
    55
9654
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9652
diff changeset
    56
function Regression::Airport()
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9652
diff changeset
    57
{
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9652
diff changeset
    58
	print("");
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9652
diff changeset
    59
	print("--AIAirport--");
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9652
diff changeset
    60
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
    61
	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
    62
	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
    63
	print("  GetHangarOfAirport(): " + AIAirport.GetHangarOfAirport(32116));
9654
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9652
diff changeset
    64
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9652
diff changeset
    65
	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
    66
		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
    67
		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
    68
		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
    69
		print("  GetAirportCoverageRadius(" + i + "): " + AIAirport.GetAirportCoverageRadius(i));
9654
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9652
diff changeset
    70
	}
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9652
diff changeset
    71
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
    72
	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
    73
	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
    74
	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
    75
	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
    76
	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
    77
	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
    78
	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
    79
	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
    80
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
    81
	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
    82
	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
    83
	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
    84
	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
    85
	print("  BuildAirport():       " + AIAirport.BuildAirport(32116, 0));
9654
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9652
diff changeset
    86
}
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9652
diff changeset
    87
9792
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
    88
function Regression::Bridge()
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
    89
{
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
    90
	local j = 0;
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
    91
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
    92
	print("");
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
    93
	print("--Bridge--");
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
    94
	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
    95
		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
    96
		print("  Bridge " + i);
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
    97
		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
    98
		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
    99
		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
   100
		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
   101
		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
   102
		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
   103
		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
   104
	}
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   105
	print("  Valid Bridges:        " + j);
9793
c5fb53240401 (svn r12297) [NoAI] -Add: added AIBridge.BuildBridge and friends
truebrain
parents: 9792
diff changeset
   106
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("  RemoveBridge():       " + AIBridge.RemoveBridge(33155));
9867
b7d9ffe24f81 (svn r12589) [NoAI] -Add: GetLastError support for AIBridge.
rubidium
parents: 9865
diff changeset
   109
	print("  GetLastErrorString(): " + AIError.GetLastErrorString());
10691
a60393d87c0b (svn r13235) [NoAI] -Change [API CHANGE]: AITunnel.GetOtherTunnelEnd() now returns INVALID_TILE if no other end is found
glx
parents: 10675
diff changeset
   110
	print("  GetOtherBridgeEnd():  " + AIBridge.GetOtherBridgeEnd(33160));
9793
c5fb53240401 (svn r12297) [NoAI] -Add: added AIBridge.BuildBridge and friends
truebrain
parents: 9792
diff changeset
   111
	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
   112
	print("  IsBridgeTile():       " + AIBridge.IsBridgeTile(33160));
c5fb53240401 (svn r12297) [NoAI] -Add: added AIBridge.BuildBridge and friends
truebrain
parents: 9792
diff changeset
   113
	print("  IsBridgeTile():       " + AIBridge.IsBridgeTile(33155));
10691
a60393d87c0b (svn r13235) [NoAI] -Change [API CHANGE]: AITunnel.GetOtherTunnelEnd() now returns INVALID_TILE if no other end is found
glx
parents: 10675
diff changeset
   114
	print("  GetOtherBridgeEnd():  " + AIBridge.GetOtherBridgeEnd(33160));
9867
b7d9ffe24f81 (svn r12589) [NoAI] -Add: GetLastError support for AIBridge.
rubidium
parents: 9865
diff changeset
   115
	print("  BuildBridge():        " + AIBridge.BuildBridge(AIVehicle.VEHICLE_ROAD, 5, 33160, 33155));
b7d9ffe24f81 (svn r12589) [NoAI] -Add: GetLastError support for AIBridge.
rubidium
parents: 9865
diff changeset
   116
	print("  GetLastErrorString(): " + AIError.GetLastErrorString());
9793
c5fb53240401 (svn r12297) [NoAI] -Add: added AIBridge.BuildBridge and friends
truebrain
parents: 9792
diff changeset
   117
	print("  RemoveBridge():       " + AIBridge.RemoveBridge(33155));
c5fb53240401 (svn r12297) [NoAI] -Add: added AIBridge.BuildBridge and friends
truebrain
parents: 9792
diff changeset
   118
	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
   119
}
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   120
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   121
function Regression::BridgeList()
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   122
{
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   123
	local list = AIBridgeList();
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   124
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   125
	print("");
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   126
	print("--BridgeList--");
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   127
	print("  Count():             " + list.Count());
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   128
	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
   129
	print("  MaxSpeed ListDump:");
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   130
	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
   131
		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
   132
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   133
	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
   134
	print("  Price ListDump:");
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   135
	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
   136
		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
   137
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   138
	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
   139
	print("  MaxLength ListDump:");
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   140
	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
   141
		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
   142
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   143
	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
   144
	print("  MinLength ListDump:");
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   145
	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
   146
		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
   147
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   148
	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
   149
	print("  YearAvailable ListDump:");
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   150
	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
   151
		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
   152
	}
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   153
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   154
	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
   155
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   156
	print("");
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   157
	print("--BridgeList_Length--");
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   158
	print("  Count():             " + list.Count());
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   159
	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
   160
	print("  MaxSpeed ListDump:");
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   161
	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
   162
		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
   163
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   164
	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
   165
	print("  Price ListDump:");
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   166
	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
   167
		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
   168
	}
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   169
}
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
   170
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
   171
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
   172
{
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
   173
	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
   174
	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
   175
	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
   176
		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
   177
		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
   178
		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
   179
		print("    IsFreight():             " + AICargo.IsFreight(i));
10675
b16fdb811ebb (svn r13219) [NoAI] -Add: added AICargo.HasCargoClass(), which allows you to find, say, passenger-based cargo (tnx kuifware for the pointer!)
truebrain
parents: 10668
diff changeset
   180
		print("    HasCargoClass():         " + AICargo.HasCargoClass(i, AICargo.CC_PASSENGERS));
10831
f7e17819358b (svn r13382) [NoAI] -Add: added AICargo::GetTownEffect()
truebrain
parents: 10776
diff changeset
   181
		print("    GetTownEffect():         " + AICargo.GetTownEffect(i));
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   182
		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
   183
		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
   184
		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
   185
		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
   186
	}
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
   187
}
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
   188
9785
edbd185e05ed (svn r12280) [NoAI] -Add: added AICargoList (Morloth)
truebrain
parents: 9776
diff changeset
   189
function Regression::CargoList()
edbd185e05ed (svn r12280) [NoAI] -Add: added AICargoList (Morloth)
truebrain
parents: 9776
diff changeset
   190
{
edbd185e05ed (svn r12280) [NoAI] -Add: added AICargoList (Morloth)
truebrain
parents: 9776
diff changeset
   191
	local list = AICargoList();
edbd185e05ed (svn r12280) [NoAI] -Add: added AICargoList (Morloth)
truebrain
parents: 9776
diff changeset
   192
edbd185e05ed (svn r12280) [NoAI] -Add: added AICargoList (Morloth)
truebrain
parents: 9776
diff changeset
   193
	print("");
edbd185e05ed (svn r12280) [NoAI] -Add: added AICargoList (Morloth)
truebrain
parents: 9776
diff changeset
   194
	print("--CargoList--");
edbd185e05ed (svn r12280) [NoAI] -Add: added AICargoList (Morloth)
truebrain
parents: 9776
diff changeset
   195
	print("  Count():            " + list.Count());
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   196
	list.Valuate(AICargo.IsFreight);
9788
e9dbd4ec1784 (svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents: 9785
diff changeset
   197
	print("  IsFreight ListDump:");
9785
edbd185e05ed (svn r12280) [NoAI] -Add: added AICargoList (Morloth)
truebrain
parents: 9776
diff changeset
   198
	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
   199
		print("    " + i + " => " + list.GetValue(i));
e9dbd4ec1784 (svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents: 9785
diff changeset
   200
	}
e9dbd4ec1784 (svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents: 9785
diff changeset
   201
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   202
	list.Valuate(AICargo.GetCargoIncome, 100, 100);
9788
e9dbd4ec1784 (svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents: 9785
diff changeset
   203
	print("  CargoIncomes(100, 100) ListDump:");
e9dbd4ec1784 (svn r12284) [NoAI] -Add: added AICargoList_v(IsFreight|CargoIncomes) (Morloth)
truebrain
parents: 9785
diff changeset
   204
	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
   205
		print("    " + i + " => " + list.GetValue(i));
9785
edbd185e05ed (svn r12280) [NoAI] -Add: added AICargoList (Morloth)
truebrain
parents: 9776
diff changeset
   206
	}
edbd185e05ed (svn r12280) [NoAI] -Add: added AICargoList (Morloth)
truebrain
parents: 9776
diff changeset
   207
}
edbd185e05ed (svn r12280) [NoAI] -Add: added AICargoList (Morloth)
truebrain
parents: 9776
diff changeset
   208
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
   209
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
   210
{
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
   211
	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
   212
	print("--Company--");
9558
4fc9b464a932 (svn r9496) [NoAI] -Add: added regression for AITestMode() and AIExecMode()
truelight
parents: 9557
diff changeset
   213
4fc9b464a932 (svn r9496) [NoAI] -Add: added regression for AITestMode() and AIExecMode()
truelight
parents: 9557
diff changeset
   214
	/* Test AIXXXMode() in scopes */
4fc9b464a932 (svn r9496) [NoAI] -Add: added regression for AITestMode() and AIExecMode()
truelight
parents: 9557
diff changeset
   215
	{
4fc9b464a932 (svn r9496) [NoAI] -Add: added regression for AITestMode() and AIExecMode()
truelight
parents: 9557
diff changeset
   216
		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
   217
		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
   218
		print("  SetCompanyName():     " + AICompany.SetCompanyName("Regression"));
9558
4fc9b464a932 (svn r9496) [NoAI] -Add: added regression for AITestMode() and AIExecMode()
truelight
parents: 9557
diff changeset
   219
		{
4fc9b464a932 (svn r9496) [NoAI] -Add: added regression for AITestMode() and AIExecMode()
truelight
parents: 9557
diff changeset
   220
			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
   221
			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
   222
			print("  SetCompanyName():     " + AICompany.SetCompanyName("Regression"));
9865
f241472f09dc (svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents: 9844
diff changeset
   223
			print("  GetLastErrorString(): " + AIError.GetLastErrorString());
9558
4fc9b464a932 (svn r9496) [NoAI] -Add: added regression for AITestMode() and AIExecMode()
truelight
parents: 9557
diff changeset
   224
		}
4fc9b464a932 (svn r9496) [NoAI] -Add: added regression for AITestMode() and AIExecMode()
truelight
parents: 9557
diff changeset
   225
	}
4fc9b464a932 (svn r9496) [NoAI] -Add: added regression for AITestMode() and AIExecMode()
truelight
parents: 9557
diff changeset
   226
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
   227
	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
   228
	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
   229
	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
   230
	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
   231
	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
   232
	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
   233
	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
   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("  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
   236
	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
   237
	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
   238
	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
   239
	print("  SetLoanAmount(10000):        " + AICompany.SetLoanAmount(10000));
9865
f241472f09dc (svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents: 9844
diff changeset
   240
	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
   241
	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
   242
	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
   243
	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
   244
	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
   245
	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
   246
	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
   247
	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
   248
	print("  GetLoanAmount():             " + AICompany.GetLoanAmount());
9808
0b40f556e051 (svn r12318) [NoAI] -Add: added AICompany::(Build|Get)CompanyHQ (college of Morloth)
truebrain
parents: 9807
diff changeset
   249
	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
   250
	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
   251
	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
   252
	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
   253
	print("  GetCompanyHQ():              " + AICompany.GetCompanyHQ(AICompany.MY_COMPANY));
9865
f241472f09dc (svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents: 9844
diff changeset
   254
	print("  BuildCompanyHQ():            " + AICompany.BuildCompanyHQ(AIMap.GetTileIndex(129, 128)));
f241472f09dc (svn r12555) [NoAI] -Add: support for GetLastError for AICompany.
rubidium
parents: 9844
diff changeset
   255
	print("  GetLastErrorString():        " + AIError.GetLastErrorString());
10291
11cb78922367 (svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents: 10193
diff changeset
   256
	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
   257
	print("  SetAutoRenewStatus(true);    " + AICompany.SetAutoRenewStatus(true));
11cb78922367 (svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents: 10193
diff changeset
   258
	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
   259
	print("  SetAutoRenewStatus(true);    " + AICompany.SetAutoRenewStatus(true));
11cb78922367 (svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents: 10193
diff changeset
   260
	print("  SetAutoRenewStatus(false);   " + AICompany.SetAutoRenewStatus(false));
11cb78922367 (svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents: 10193
diff changeset
   261
	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
   262
	print("  SetAutoRenewMonths(-12);     " + AICompany.SetAutoRenewMonths(-12));
11cb78922367 (svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents: 10193
diff changeset
   263
	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
   264
	print("  SetAutoRenewMonths(-12);     " + AICompany.SetAutoRenewMonths(-12));
11cb78922367 (svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents: 10193
diff changeset
   265
	print("  SetAutoRenewMonths(6);       " + AICompany.SetAutoRenewMonths(6));
11cb78922367 (svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents: 10193
diff changeset
   266
	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
   267
	print("  SetAutoRenewMoney(200000);   " + AICompany.SetAutoRenewMoney(200000));
11cb78922367 (svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents: 10193
diff changeset
   268
	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
   269
	print("  SetAutoRenewMoney(200000);   " + AICompany.SetAutoRenewMoney(200000));
11cb78922367 (svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents: 10193
diff changeset
   270
	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
   271
}
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
   272
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
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
   274
{
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
   275
	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
   276
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
   277
	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
   278
	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
   279
	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
   280
		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
   281
		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
   282
		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
   283
		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
   284
		print("    GetCargoType():     " + AIEngine.GetCargoType(i));
9809
9b21c21052fa (svn r12325) [NoAI] -Add: added AIEngine:CanRefitCargo()
truebrain
parents: 9808
diff changeset
   285
		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
   286
		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
   287
		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
   288
		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
   289
		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
   290
		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
   291
		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
   292
		print("    GetVehicleType():   " + AIEngine.GetVehicleType(i));
10668
495789401303 (svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents: 10650
diff changeset
   293
		print("    GetRoadType():      " + AIEngine.GetRoadType(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
   294
	}
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
   295
	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
   296
}
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
   297
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
   298
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
   299
{
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
	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
   301
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("");
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
	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
   304
	print("  Count():             " + list.Count());
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   305
	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
   306
	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
   307
	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
   308
		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
   309
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   310
	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
   311
	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
   312
	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
   313
		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
   314
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   315
	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
   316
	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
   317
	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
   318
		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
   319
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   320
	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
   321
	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
   322
	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
   323
		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
   324
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   325
	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
   326
	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
   327
	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
   328
		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
   329
	}
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
   330
}
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
   331
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
   332
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
   333
{
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
	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
   335
	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
   336
	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
   337
	local e = AIEventController.GetNextEvent();
9684
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9682
diff changeset
   338
	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
   339
	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
   340
	local c = AIEventTest.Convert(e);
9684
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9682
diff changeset
   341
	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
   342
	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
   343
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
	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
   345
	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
   346
	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
   347
	e = AIEventController.GetNextEvent();
9684
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9682
diff changeset
   348
	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
   349
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
	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
   351
	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
   352
	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
   353
	e = AIEventController.GetNextEvent();
9684
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9682
diff changeset
   354
	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
   355
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
	{
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
		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
   358
		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
   359
		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
   360
		e = AIEventController.GetNextEvent();
9684
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9682
diff changeset
   361
		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
   362
	}
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
   363
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
	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
   365
	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
   366
	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
   367
	e = AIEventController.GetNextEvent();
9684
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9682
diff changeset
   368
	print("  GetNextEvent:      " + (e == null ? "null" : "instance"));
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9682
diff changeset
   369
	e = AIEventController.GetNextEvent();
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9682
diff changeset
   370
	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
   371
0b7f816cf46f (svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents: 9814
diff changeset
   372
	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
   373
}
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
   374
10918
317f736e5fc6 (svn r13470) [NoAI] -Change [Library CHANGE]: allow in graph.aystar to give a custom param to the callbacks, so you can send in an instance of yourself
truebrain
parents: 10912
diff changeset
   375
function cost_callback(old_path, new_tile, self) { if (old_path == null) return 0; return old_path.GetCost() + 1; }
317f736e5fc6 (svn r13470) [NoAI] -Change [Library CHANGE]: allow in graph.aystar to give a custom param to the callbacks, so you can send in an instance of yourself
truebrain
parents: 10912
diff changeset
   376
function estimate_callback(tile, goals, self) { return goals[0] - tile; }
317f736e5fc6 (svn r13470) [NoAI] -Change [Library CHANGE]: allow in graph.aystar to give a custom param to the callbacks, so you can send in an instance of yourself
truebrain
parents: 10912
diff changeset
   377
function neighbours_callback(path, cur_tile, self) { return [cur_tile + 1]; }
10910
85f71706f496 (svn r13461) [NoAI] -Fix: add A* to regression, so we test it a bit (very basic test ;))
truebrain
parents: 10904
diff changeset
   378
85f71706f496 (svn r13461) [NoAI] -Fix: add A* to regression, so we test it a bit (very basic test ;))
truebrain
parents: 10904
diff changeset
   379
function Regression::Graph()
85f71706f496 (svn r13461) [NoAI] -Fix: add A* to regression, so we test it a bit (very basic test ;))
truebrain
parents: 10904
diff changeset
   380
{
85f71706f496 (svn r13461) [NoAI] -Fix: add A* to regression, so we test it a bit (very basic test ;))
truebrain
parents: 10904
diff changeset
   381
	print("--AyStar--");
85f71706f496 (svn r13461) [NoAI] -Fix: add A* to regression, so we test it a bit (very basic test ;))
truebrain
parents: 10904
diff changeset
   382
	print("  Fastest path:");
10912
48d072a192b5 (svn r13463) [NoAI] -Change [Library CHANGE]: AyStar is now more object oriented, and you can indicate the amount of iterations FindPath should do in one go (tnx to Yexo and TrueBrain)
truebrain
parents: 10910
diff changeset
   383
	local as = AS(cost_callback, estimate_callback, neighbours_callback);
48d072a192b5 (svn r13463) [NoAI] -Change [Library CHANGE]: AyStar is now more object oriented, and you can indicate the amount of iterations FindPath should do in one go (tnx to Yexo and TrueBrain)
truebrain
parents: 10910
diff changeset
   384
48d072a192b5 (svn r13463) [NoAI] -Change [Library CHANGE]: AyStar is now more object oriented, and you can indicate the amount of iterations FindPath should do in one go (tnx to Yexo and TrueBrain)
truebrain
parents: 10910
diff changeset
   385
	local path = false;
48d072a192b5 (svn r13463) [NoAI] -Change [Library CHANGE]: AyStar is now more object oriented, and you can indicate the amount of iterations FindPath should do in one go (tnx to Yexo and TrueBrain)
truebrain
parents: 10910
diff changeset
   386
	as.InitializePath([1], [10]);
48d072a192b5 (svn r13463) [NoAI] -Change [Library CHANGE]: AyStar is now more object oriented, and you can indicate the amount of iterations FindPath should do in one go (tnx to Yexo and TrueBrain)
truebrain
parents: 10910
diff changeset
   387
	while (path == false) path = as.FindPath(5);
48d072a192b5 (svn r13463) [NoAI] -Change [Library CHANGE]: AyStar is now more object oriented, and you can indicate the amount of iterations FindPath should do in one go (tnx to Yexo and TrueBrain)
truebrain
parents: 10910
diff changeset
   388
10910
85f71706f496 (svn r13461) [NoAI] -Fix: add A* to regression, so we test it a bit (very basic test ;))
truebrain
parents: 10904
diff changeset
   389
	while (path != null) {
10912
48d072a192b5 (svn r13463) [NoAI] -Change [Library CHANGE]: AyStar is now more object oriented, and you can indicate the amount of iterations FindPath should do in one go (tnx to Yexo and TrueBrain)
truebrain
parents: 10910
diff changeset
   390
		print("    Tile " + path.GetNode());
10910
85f71706f496 (svn r13461) [NoAI] -Fix: add A* to regression, so we test it a bit (very basic test ;))
truebrain
parents: 10904
diff changeset
   391
		path = path.GetParent();
85f71706f496 (svn r13461) [NoAI] -Fix: add A* to regression, so we test it a bit (very basic test ;))
truebrain
parents: 10904
diff changeset
   392
	}
85f71706f496 (svn r13461) [NoAI] -Fix: add A* to regression, so we test it a bit (very basic test ;))
truebrain
parents: 10904
diff changeset
   393
}
85f71706f496 (svn r13461) [NoAI] -Fix: add A* to regression, so we test it a bit (very basic test ;))
truebrain
parents: 10904
diff changeset
   394
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
   395
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
   396
{
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
   397
	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
   398
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
   399
	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
   400
	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
   401
	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
   402
	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
   403
	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
   404
		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
   405
		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
   406
		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
   407
		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
   408
		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
   409
		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
   410
		print("    IsCargoAccepted(): " + AIIndustry.IsCargoAccepted(i, 1));
9810
a84fc1be9e3b (svn r12327) [NoAI] -Add: GetLastMonth(Production|Transported) (Morloth)
truebrain
parents: 9809
diff changeset
   411
a84fc1be9e3b (svn r12327) [NoAI] -Add: GetLastMonth(Production|Transported) (Morloth)
truebrain
parents: 9809
diff changeset
   412
		local cargo_list = AICargoList();
a84fc1be9e3b (svn r12327) [NoAI] -Add: GetLastMonth(Production|Transported) (Morloth)
truebrain
parents: 9809
diff changeset
   413
		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
   414
			if (AIIndustry.GetProduction(i, j) > 0) {
a84fc1be9e3b (svn r12327) [NoAI] -Add: GetLastMonth(Production|Transported) (Morloth)
truebrain
parents: 9809
diff changeset
   415
				print("	   GetLastMonthProduction(): " + AIIndustry.GetLastMonthProduction(i, j));
a84fc1be9e3b (svn r12327) [NoAI] -Add: GetLastMonth(Production|Transported) (Morloth)
truebrain
parents: 9809
diff changeset
   416
				print("	   GetLastMonthTransported(): " + AIIndustry.GetLastMonthTransported(i, j));
a84fc1be9e3b (svn r12327) [NoAI] -Add: GetLastMonth(Production|Transported) (Morloth)
truebrain
parents: 9809
diff changeset
   417
			}
a84fc1be9e3b (svn r12327) [NoAI] -Add: GetLastMonth(Production|Transported) (Morloth)
truebrain
parents: 9809
diff changeset
   418
		}
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
   419
	}
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
   420
	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
   421
	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
   422
}
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
   423
9649
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
   424
function Regression::IndustryList()
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
   425
{
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
   426
	local list = AIIndustryList();
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
   427
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
   428
	print("");
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
   429
	print("--IndustryList--");
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
   430
	print("  Count():             " + list.Count());
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   431
	list.Valuate(AIIndustry.GetLocation);
9649
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
   432
	print("  Location ListDump:");
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
   433
	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
   434
		print("    " + i + " => " + list.GetValue(i));
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
   435
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   436
	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
   437
	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
   438
	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
   439
		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
   440
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   441
	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
   442
	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
   443
	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
   444
		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
   445
	}
10383
bda80b3e9c25 (svn r12925) [NoAI] -Add: added AIIndustry::GetAmountOfStationsAround() (Yexo)
truebrain
parents: 10381
diff changeset
   446
	list.Valuate(AIIndustry.GetAmountOfStationsAround);
bda80b3e9c25 (svn r12925) [NoAI] -Add: added AIIndustry::GetAmountOfStationsAround() (Yexo)
truebrain
parents: 10381
diff changeset
   447
	print("  GetAmountOfStationsAround(30000) ListDump:");
bda80b3e9c25 (svn r12925) [NoAI] -Add: added AIIndustry::GetAmountOfStationsAround() (Yexo)
truebrain
parents: 10381
diff changeset
   448
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
bda80b3e9c25 (svn r12925) [NoAI] -Add: added AIIndustry::GetAmountOfStationsAround() (Yexo)
truebrain
parents: 10381
diff changeset
   449
		print("    " + i + " => " + list.GetValue(i));
bda80b3e9c25 (svn r12925) [NoAI] -Add: added AIIndustry::GetAmountOfStationsAround() (Yexo)
truebrain
parents: 10381
diff changeset
   450
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   451
	list.Valuate(AIIndustry.IsCargoAccepted, 1);
9710
ba44f8c1fd52 (svn r11294) [NoAI] -Add: added AIIndustry::IsCargoAccepted + Valuator (on request by Kilinich)
truelight
parents: 9709
diff changeset
   452
	print("  CargoAccepted(1) ListDump:");
ba44f8c1fd52 (svn r11294) [NoAI] -Add: added AIIndustry::IsCargoAccepted + Valuator (on request by Kilinich)
truelight
parents: 9709
diff changeset
   453
	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
   454
		print("    " + i + " => " + list.GetValue(i));
ba44f8c1fd52 (svn r11294) [NoAI] -Add: added AIIndustry::IsCargoAccepted + Valuator (on request by Kilinich)
truelight
parents: 9709
diff changeset
   455
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   456
	list.Valuate(AIIndustry.GetProduction, 1);
9649
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
   457
	list.KeepAboveValue(50);
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
   458
	print("  KeepAboveValue(50): done");
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
   459
	print("  Count():             " + list.Count());
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
   460
	print("  Production ListDump:");
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
   461
	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
   462
		print("    " + i + " => " + list.GetValue(i));
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
   463
	}
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
   464
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
   465
	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
   466
	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
   467
	print("  Count():             " + list.Count());
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   468
	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
   469
	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
   470
	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
   471
		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
   472
	}
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
   473
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
   474
	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
   475
	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
   476
	print("  Count():             " + list.Count());
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   477
	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
   478
	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
   479
	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
   480
		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
   481
	}
9649
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
   482
}
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
   483
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   484
function CustomValuator(list_id)
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   485
{
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   486
	return list_id * 4343;
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   487
}
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   488
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
   489
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
   490
{
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
   491
	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
   492
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
   493
	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
   494
	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
   495
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
   496
	print("  IsEmpty():     " + list.IsEmpty());
9664
c5741021bf59 (svn r10577) [NoAI] -Add: added ChangeItem to AIList
truelight
parents: 9660
diff changeset
   497
	list.AddItem(1, 1);
c5741021bf59 (svn r10577) [NoAI] -Add: added ChangeItem to AIList
truelight
parents: 9660
diff changeset
   498
	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
   499
	for (local i = 1000; i < 1100; i++) {
9664
c5741021bf59 (svn r10577) [NoAI] -Add: added ChangeItem to AIList
truelight
parents: 9660
diff changeset
   500
		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
   501
	}
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
   502
	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
   503
	list.RemoveItem(1150);
9664
c5741021bf59 (svn r10577) [NoAI] -Add: added ChangeItem to AIList
truelight
parents: 9660
diff changeset
   504
	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
   505
	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
   506
	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
   507
	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
   508
	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
   509
	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
   510
	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
   511
	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
   512
		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
   513
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   514
	list.Valuate(CustomValuator);
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   515
	print("  Custom ListDump:");
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   516
	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
   517
		print("    " + i + " => " + list.GetValue(i));
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   518
	}
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   519
	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
   520
	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
   521
	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
   522
		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
   523
	}
9665
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   524
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   525
	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
   526
	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
   527
	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
   528
		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
   529
	}
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   530
	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
   531
	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
   532
	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
   533
		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
   534
	}
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   535
	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
   536
	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
   537
	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
   538
		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
   539
	}
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   540
	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
   541
	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
   542
	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
   543
		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
   544
	}
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   545
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   546
	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
   547
	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
   548
	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
   549
	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
   550
	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
   551
	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
   552
		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
   553
	}
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   554
	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
   555
	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
   556
	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
   557
	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
   558
		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
   559
	}
9796
83d54622190c (svn r12300) [NoAI] -Add: added AIAbstractList.AddList() (on request by Progman)
truebrain
parents: 9794
diff changeset
   560
	list2.Clear();
83d54622190c (svn r12300) [NoAI] -Add: added AIAbstractList.AddList() (on request by Progman)
truebrain
parents: 9794
diff changeset
   561
	for (local i = 4000; i < 4003; i++) {
83d54622190c (svn r12300) [NoAI] -Add: added AIAbstractList.AddList() (on request by Progman)
truebrain
parents: 9794
diff changeset
   562
		list2.AddItem(i, i);
83d54622190c (svn r12300) [NoAI] -Add: added AIAbstractList.AddList() (on request by Progman)
truebrain
parents: 9794
diff changeset
   563
	}
83d54622190c (svn r12300) [NoAI] -Add: added AIAbstractList.AddList() (on request by Progman)
truebrain
parents: 9794
diff changeset
   564
	list2.AddItem(1005, 1005);
83d54622190c (svn r12300) [NoAI] -Add: added AIAbstractList.AddList() (on request by Progman)
truebrain
parents: 9794
diff changeset
   565
	list.AddList(list2);
83d54622190c (svn r12300) [NoAI] -Add: added AIAbstractList.AddList() (on request by Progman)
truebrain
parents: 9794
diff changeset
   566
	print("  AddList({1005, 4000, 4001, 4002}):");
83d54622190c (svn r12300) [NoAI] -Add: added AIAbstractList.AddList() (on request by Progman)
truebrain
parents: 9794
diff changeset
   567
	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
   568
		print("    " + i + " => " + list.GetValue(i));
83d54622190c (svn r12300) [NoAI] -Add: added AIAbstractList.AddList() (on request by Progman)
truebrain
parents: 9794
diff changeset
   569
	}
9665
e889ac1e663a (svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents: 9664
diff changeset
   570
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
   571
	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
   572
	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
   573
}
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
   574
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
   575
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
   576
{
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
   577
	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
   578
	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
   579
	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
   580
	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
   581
	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
   582
	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
   583
	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
   584
	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
   585
	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
   586
	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
   587
	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
   588
	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
   589
	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
   590
	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
   591
	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
   592
	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
   593
	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
   594
	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
   595
	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
   596
	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
   597
	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
   598
	print("  DemolishTile():   " + AITile.DemolishTile(19335));
9492
1aeee24046d8 (svn r9362) [NoAI] -Add: added the new AIMap() functions to regression-test
truelight
parents: 9487
diff changeset
   599
	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
   600
	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
   601
	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
   602
	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
   603
	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
   604
}
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
   605
9691
1231d4e5f5aa (svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents: 9684
diff changeset
   606
function Regression::Marine()
1231d4e5f5aa (svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents: 9684
diff changeset
   607
{
1231d4e5f5aa (svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents: 9684
diff changeset
   608
	print("");
1231d4e5f5aa (svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents: 9684
diff changeset
   609
	print("--AIMarine--");
1231d4e5f5aa (svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents: 9684
diff changeset
   610
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
   611
	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
   612
	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
   613
	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
   614
	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
   615
	print("  IsCanalTile():        " + AIMarine.IsCanalTile(32116));
9691
1231d4e5f5aa (svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents: 9684
diff changeset
   616
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
   617
	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
   618
	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
   619
	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
   620
	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
   621
	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
   622
	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
   623
	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
   624
	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
   625
	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
   626
	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
   627
	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
   628
	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
   629
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
   630
	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
   631
	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
   632
	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
   633
	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
   634
	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
   635
	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
   636
	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
   637
	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
   638
	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
   639
	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
   640
	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
   641
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
   642
	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
   643
	print("  BuildDock():          " + AIMarine.BuildDock(29253));
9691
1231d4e5f5aa (svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents: 9684
diff changeset
   644
}
1231d4e5f5aa (svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents: 9684
diff changeset
   645
9546
fde20f518285 (svn r9477) [NoAI] -Add: added regression-test for AIOrder()
truelight
parents: 9541
diff changeset
   646
function Regression::Order()
fde20f518285 (svn r9477) [NoAI] -Add: added regression-test for AIOrder()
truelight
parents: 9541
diff changeset
   647
{
fde20f518285 (svn r9477) [NoAI] -Add: added regression-test for AIOrder()
truelight
parents: 9541
diff changeset
   648
	print("");
fde20f518285 (svn r9477) [NoAI] -Add: added regression-test for AIOrder()
truelight
parents: 9541
diff changeset
   649
	print("--Order--");
10844
affb2821fb9f (svn r13395) [NoAI] -Fix [API CHANGE]: Rename AIOrder::GetNumberOfORders to AIOrder::GetOrderCount
truebrain
parents: 10831
diff changeset
   650
	print("  GetOrderCount():       " + AIOrder.GetOrderCount(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
   651
	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
   652
	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
   653
	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
   654
	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
   655
	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
   656
	print("  InsertOrder():         " + AIOrder.InsertOrder(11, 0, 33416, AIOrder.AIOF_TRANSFER));
10844
affb2821fb9f (svn r13395) [NoAI] -Fix [API CHANGE]: Rename AIOrder::GetNumberOfORders to AIOrder::GetOrderCount
truebrain
parents: 10831
diff changeset
   657
	print("  GetOrderCount():       " + AIOrder.GetOrderCount(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
   658
	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
   659
	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
   660
	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
   661
	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
   662
	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
   663
	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
   664
	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
   665
	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
   666
	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
   667
	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
   668
9745
fb2454d70f37 (svn r12225) [NoAI] -Change [API CHANGE]: AIStationVehicleList -> AIVehicleList_Station (WATCH THE NAMES CAREFULLY!)
truebrain
parents: 9737
diff changeset
   669
	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
   670
25126afa0c25 (svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents: 9638
diff changeset
   671
	print("");
9745
fb2454d70f37 (svn r12225) [NoAI] -Change [API CHANGE]: AIStationVehicleList -> AIVehicleList_Station (WATCH THE NAMES CAREFULLY!)
truebrain
parents: 9737
diff changeset
   672
	print("--StationList_Vehicle--");
9645
25126afa0c25 (svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents: 9638
diff changeset
   673
	print("  Count():             " + list.Count());
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   674
	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
   675
	print("  Location ListDump:");
25126afa0c25 (svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents: 9638
diff changeset
   676
	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
   677
		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
   678
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   679
	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
   680
	print("  CargoWaiting(0) ListDump:");
25126afa0c25 (svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents: 9638
diff changeset
   681
	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
   682
		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
   683
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   684
	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
   685
	print("  CargoWaiting(1) ListDump:");
25126afa0c25 (svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents: 9638
diff changeset
   686
	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
   687
		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
   688
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   689
	list.Valuate(AIStation.GetCargoRating, 1);
9648
760b7b504e37 (svn r10543) [NoAI] -Add: added AIStationListCargoRating as valuator for a station list
truelight
parents: 9647
diff changeset
   690
	print("  CargoRating(1) ListDump:");
760b7b504e37 (svn r10543) [NoAI] -Add: added AIStationListCargoRating as valuator for a station list
truelight
parents: 9647
diff changeset
   691
	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
   692
		print("    " + i + " => " + list.GetValue(i));
760b7b504e37 (svn r10543) [NoAI] -Add: added AIStationListCargoRating as valuator for a station list
truelight
parents: 9647
diff changeset
   693
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   694
	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
   695
	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
   696
	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
   697
		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
   698
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   699
	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
   700
	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
   701
	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
   702
		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
   703
	}
10361
4cdffd48480f (svn r12902) [NoAI] -Fix r12901 [API CHANGE]: renamed IsWithinTownRadius to IsWithinTownInfluence, as that reflects the meaning much better
truebrain
parents: 10360
diff changeset
   704
	list.Valuate(AIStation.IsWithinTownInfluence, 0);
4cdffd48480f (svn r12902) [NoAI] -Fix r12901 [API CHANGE]: renamed IsWithinTownRadius to IsWithinTownInfluence, as that reflects the meaning much better
truebrain
parents: 10360
diff changeset
   705
	print("  IsWithinTownInfluence(0) ListDump:");
10360
3234cb59de55 (svn r12901) [NoAI] -Add: added AITown.IsWithinTownRadius, AIStation.IsWithinTownRadius and AITile.GetOwner (Yexo)
truebrain
parents: 10344
diff changeset
   706
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
3234cb59de55 (svn r12901) [NoAI] -Add: added AITown.IsWithinTownRadius, AIStation.IsWithinTownRadius and AITile.GetOwner (Yexo)
truebrain
parents: 10344
diff changeset
   707
		print("    " + i + " => " + list.GetValue(i));
3234cb59de55 (svn r12901) [NoAI] -Add: added AITown.IsWithinTownRadius, AIStation.IsWithinTownRadius and AITile.GetOwner (Yexo)
truebrain
parents: 10344
diff changeset
   708
	}
9647
c17046b1b8a2 (svn r10540) [NoAI] -Add: added AIStationVehicleList, which lists all vehicles that go to a given station
truelight
parents: 9645
diff changeset
   709
9745
fb2454d70f37 (svn r12225) [NoAI] -Change [API CHANGE]: AIStationVehicleList -> AIVehicleList_Station (WATCH THE NAMES CAREFULLY!)
truebrain
parents: 9737
diff changeset
   710
	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
   711
c17046b1b8a2 (svn r10540) [NoAI] -Add: added AIStationVehicleList, which lists all vehicles that go to a given station
truelight
parents: 9645
diff changeset
   712
	print("");
9745
fb2454d70f37 (svn r12225) [NoAI] -Change [API CHANGE]: AIStationVehicleList -> AIVehicleList_Station (WATCH THE NAMES CAREFULLY!)
truebrain
parents: 9737
diff changeset
   713
	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
   714
	print("  Count():             " + list.Count());
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   715
	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
   716
	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
   717
	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
   718
		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
   719
	}
9546
fde20f518285 (svn r9477) [NoAI] -Add: added regression-test for AIOrder()
truelight
parents: 9541
diff changeset
   720
}
fde20f518285 (svn r9477) [NoAI] -Add: added regression-test for AIOrder()
truelight
parents: 9541
diff changeset
   721
10896
6bb839ed0002 (svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents: 10889
diff changeset
   722
function Regression::QueueTest(queue)
6bb839ed0002 (svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents: 10889
diff changeset
   723
{
6bb839ed0002 (svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents: 10889
diff changeset
   724
	print("  Count(): " + queue.Count());
6bb839ed0002 (svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents: 10889
diff changeset
   725
	print("  Peek():  " + queue.Peek());
6bb839ed0002 (svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents: 10889
diff changeset
   726
	print("  Pop():   " + queue.Pop());
10904
3070af6d1d25 (svn r13455) [NoAI] -Fix: extend the regression to test the queues a bit more
truebrain
parents: 10899
diff changeset
   727
	queue.Insert(6, 20);
3070af6d1d25 (svn r13455) [NoAI] -Fix: extend the regression to test the queues a bit more
truebrain
parents: 10899
diff changeset
   728
	queue.Insert(7, 40);
3070af6d1d25 (svn r13455) [NoAI] -Fix: extend the regression to test the queues a bit more
truebrain
parents: 10899
diff changeset
   729
	queue.Insert(2, 10);
3070af6d1d25 (svn r13455) [NoAI] -Fix: extend the regression to test the queues a bit more
truebrain
parents: 10899
diff changeset
   730
	queue.Insert(5, 15);
3070af6d1d25 (svn r13455) [NoAI] -Fix: extend the regression to test the queues a bit more
truebrain
parents: 10899
diff changeset
   731
	queue.Insert(8, 60);
3070af6d1d25 (svn r13455) [NoAI] -Fix: extend the regression to test the queues a bit more
truebrain
parents: 10899
diff changeset
   732
	queue.Insert(1,  5);
10896
6bb839ed0002 (svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents: 10889
diff changeset
   733
	queue.Insert(3, 10);
10904
3070af6d1d25 (svn r13455) [NoAI] -Fix: extend the regression to test the queues a bit more
truebrain
parents: 10899
diff changeset
   734
	queue.Insert(9, 90);
3070af6d1d25 (svn r13455) [NoAI] -Fix: extend the regression to test the queues a bit more
truebrain
parents: 10899
diff changeset
   735
	queue.Insert(4, 10);
10896
6bb839ed0002 (svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents: 10889
diff changeset
   736
	print("  Count(): " + queue.Count());
6bb839ed0002 (svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents: 10889
diff changeset
   737
	print("  Peek():  " + queue.Peek());
10904
3070af6d1d25 (svn r13455) [NoAI] -Fix: extend the regression to test the queues a bit more
truebrain
parents: 10899
diff changeset
   738
	for (local i = 4; i > 0; i--) {
3070af6d1d25 (svn r13455) [NoAI] -Fix: extend the regression to test the queues a bit more
truebrain
parents: 10899
diff changeset
   739
		print("  Pop():   " + queue.Pop());
3070af6d1d25 (svn r13455) [NoAI] -Fix: extend the regression to test the queues a bit more
truebrain
parents: 10899
diff changeset
   740
	}
3070af6d1d25 (svn r13455) [NoAI] -Fix: extend the regression to test the queues a bit more
truebrain
parents: 10899
diff changeset
   741
	queue.Insert(1, 5);
3070af6d1d25 (svn r13455) [NoAI] -Fix: extend the regression to test the queues a bit more
truebrain
parents: 10899
diff changeset
   742
	queue.Insert(10, 100);
3070af6d1d25 (svn r13455) [NoAI] -Fix: extend the regression to test the queues a bit more
truebrain
parents: 10899
diff changeset
   743
	for (local i = queue.Count(); i > 0; i--) {
3070af6d1d25 (svn r13455) [NoAI] -Fix: extend the regression to test the queues a bit more
truebrain
parents: 10899
diff changeset
   744
		print("  Pop():   " + queue.Pop());
3070af6d1d25 (svn r13455) [NoAI] -Fix: extend the regression to test the queues a bit more
truebrain
parents: 10899
diff changeset
   745
	}
10896
6bb839ed0002 (svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents: 10889
diff changeset
   746
	print("  Peek():  " + queue.Peek());
6bb839ed0002 (svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents: 10889
diff changeset
   747
	print("  Pop():   " + queue.Pop());
6bb839ed0002 (svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents: 10889
diff changeset
   748
	print("  Count(): " + queue.Count());
6bb839ed0002 (svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents: 10889
diff changeset
   749
}
6bb839ed0002 (svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents: 10889
diff changeset
   750
6bb839ed0002 (svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents: 10889
diff changeset
   751
function Regression::Queues()
6bb839ed0002 (svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents: 10889
diff changeset
   752
{
6bb839ed0002 (svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents: 10889
diff changeset
   753
	print("");
6bb839ed0002 (svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents: 10889
diff changeset
   754
	print("--PriorityQueue--");
6bb839ed0002 (svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents: 10889
diff changeset
   755
	QueueTest(PQ());
6bb839ed0002 (svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents: 10889
diff changeset
   756
	print("");
6bb839ed0002 (svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents: 10889
diff changeset
   757
	print("--BinaryHeap--");
6bb839ed0002 (svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents: 10889
diff changeset
   758
	QueueTest(BH());
6bb839ed0002 (svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents: 10889
diff changeset
   759
}
6bb839ed0002 (svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents: 10889
diff changeset
   760
9485
df09b849ca60 (svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents: 9470
diff changeset
   761
function Regression::Road()
df09b849ca60 (svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents: 9470
diff changeset
   762
{
df09b849ca60 (svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents: 9470
diff changeset
   763
	print("");
df09b849ca60 (svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents: 9470
diff changeset
   764
	print("--Road--");
df09b849ca60 (svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents: 9470
diff changeset
   765
	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
   766
	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
   767
	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
   768
	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
   769
	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
   770
	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
   771
	print("    IsRoadTile():                  " + AIRoad.IsRoadTile(33411));
10668
495789401303 (svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents: 10650
diff changeset
   772
	print("    HasRoadType(Road):             " + AIRoad.HasRoadType(33411, AIRoad.ROADTYPE_ROAD));
495789401303 (svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents: 10650
diff changeset
   773
	print("    HasRoadType(Tram):             " + AIRoad.HasRoadType(33411, AIRoad.ROADTYPE_TRAM));
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
   774
	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
   775
	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
   776
	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
   777
	print("    RemoveRoad():                  " + AIRoad.RemoveRoad(19590, 19590));
10668
495789401303 (svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents: 10650
diff changeset
   778
	print("    IsRoadTypeAvailable(Road):     " + AIRoad.IsRoadTypeAvailable(AIRoad.ROADTYPE_ROAD));
495789401303 (svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents: 10650
diff changeset
   779
	print("    IsRoadTypeAvailable(Tram):     " + AIRoad.IsRoadTypeAvailable(AIRoad.ROADTYPE_TRAM));
495789401303 (svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents: 10650
diff changeset
   780
	print("    SetCurrentRoadType(Tram):      " + AIRoad.SetCurrentRoadType(AIRoad.ROADTYPE_TRAM));
495789401303 (svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents: 10650
diff changeset
   781
	print("    GetCurrentRoadType():          " + AIRoad.GetCurrentRoadType());
9485
df09b849ca60 (svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents: 9470
diff changeset
   782
df09b849ca60 (svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents: 9470
diff changeset
   783
	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
   784
	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
   785
	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
   786
	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
   787
	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
   788
	print("    BuildRoadDepot():              " + AIRoad.BuildRoadDepot(33411, 33412));
10668
495789401303 (svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents: 10650
diff changeset
   789
	print("    HasRoadType(Road):             " + AIRoad.HasRoadType(33411, AIRoad.ROADTYPE_ROAD));
495789401303 (svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents: 10650
diff changeset
   790
	print("    HasRoadType(Tram):             " + AIRoad.HasRoadType(33411, AIRoad.ROADTYPE_TRAM));
9844
738b8f69675f (svn r12510) [NoAI] -Add: added AIError, which allows you to catch errors triggered by commands (Morloth)
truebrain
parents: 9834
diff changeset
   791
	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
   792
	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
   793
	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
   794
	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
   795
	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
   796
	print("    IsRoadDepotTile():             " + AIRoad.IsRoadDepotTile(33411));
9769
015b6674c8ad (svn r12259) [NoAI] -Fix: depots were considered buildable (tnx Progman)
truebrain
parents: 9758
diff changeset
   797
	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
   798
	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
   799
	print("    RemoveRoadDepot():             " + AIRoad.RemoveRoadDepot(33411));
9485
df09b849ca60 (svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents: 9470
diff changeset
   800
df09b849ca60 (svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents: 9470
diff changeset
   801
	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
   802
	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
   803
	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
   804
	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
   805
	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
   806
	print("    BuildRoadStation():            " + AIRoad.BuildRoadStation(33411, 33412, false, false));
10668
495789401303 (svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents: 10650
diff changeset
   807
	print("    HasRoadType(Road):             " + AIRoad.HasRoadType(33411, AIRoad.ROADTYPE_ROAD));
495789401303 (svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents: 10650
diff changeset
   808
	print("    HasRoadType(Tram):             " + AIRoad.HasRoadType(33411, AIRoad.ROADTYPE_TRAM));
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
   809
	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
   810
	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
   811
	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
   812
	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
   813
	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
   814
	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
   815
	print("    RemoveRoadStation():           " + AIRoad.RemoveRoadStation(33411));
9485
df09b849ca60 (svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents: 9470
diff changeset
   816
df09b849ca60 (svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents: 9470
diff changeset
   817
	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
   818
	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
   819
	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
   820
	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
   821
	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
   822
	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
   823
	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
   824
	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
   825
	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
   826
	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
   827
	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
   828
	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
   829
	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
   830
	print("    IsDriveThroughRoadStationTile: " + AIRoad.IsDriveThroughRoadStationTile(33415));
9769
015b6674c8ad (svn r12259) [NoAI] -Fix: depots were considered buildable (tnx Progman)
truebrain
parents: 9758
diff changeset
   831
	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
   832
	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
   833
	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
   834
	print("    IsRoadTile():                  " + AIRoad.IsRoadTile(33415));
9485
df09b849ca60 (svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents: 9470
diff changeset
   835
}
df09b849ca60 (svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents: 9470
diff changeset
   836
9511
f767ad06e86b (svn r9407) [NoAI] -Add: placing of signs.
rubidium
parents: 9492
diff changeset
   837
function Regression::Sign()
f767ad06e86b (svn r9407) [NoAI] -Add: placing of signs.
rubidium
parents: 9492
diff changeset
   838
{
f767ad06e86b (svn r9407) [NoAI] -Add: placing of signs.
rubidium
parents: 9492
diff changeset
   839
	local j = 0;
f767ad06e86b (svn r9407) [NoAI] -Add: placing of signs.
rubidium
parents: 9492
diff changeset
   840
f767ad06e86b (svn r9407) [NoAI] -Add: placing of signs.
rubidium
parents: 9492
diff changeset
   841
	print("");
f767ad06e86b (svn r9407) [NoAI] -Add: placing of signs.
rubidium
parents: 9492
diff changeset
   842
	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
   843
	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
   844
	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
   845
	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
   846
	print("  RemoveSign(" + AISign_id + "):                       " + AISign.RemoveSign(AISign_id));
9511
f767ad06e86b (svn r9407) [NoAI] -Add: placing of signs.
rubidium
parents: 9492
diff changeset
   847
	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
   848
	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
   849
	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
   850
		if (AISign.IsValidSign(i)) j++;
9511
f767ad06e86b (svn r9407) [NoAI] -Add: placing of signs.
rubidium
parents: 9492
diff changeset
   851
		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
   852
		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
   853
		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
   854
		print("    GetLocation():   " + AISign.GetLocation(i));
10847
6c003b73a276 (svn r13398) [NoAI] -Add: added AISign::GetOwner (on request by Finaldeath)
truebrain
parents: 10844
diff changeset
   855
		print("    GetOwner():      " + AISign.GetOwner(i));
10856
c7b29152d594 (svn r13407) [NoAI] -Add: added AICompany::IsMine() to ease up owner-checks (no, not the ones to cash in money)
truebrain
parents: 10852
diff changeset
   856
		print("    IsMine():        " + AICompany.IsMine(AISign.GetOwner(i)));
9511
f767ad06e86b (svn r9407) [NoAI] -Add: placing of signs.
rubidium
parents: 9492
diff changeset
   857
	}
f767ad06e86b (svn r9407) [NoAI] -Add: placing of signs.
rubidium
parents: 9492
diff changeset
   858
	print("  Valid Signs:       " + j);
f767ad06e86b (svn r9407) [NoAI] -Add: placing of signs.
rubidium
parents: 9492
diff changeset
   859
}
f767ad06e86b (svn r9407) [NoAI] -Add: placing of signs.
rubidium
parents: 9492
diff changeset
   860
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
   861
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
   862
{
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
   863
	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
   864
	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
   865
	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
   866
	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
   867
	print("  GetName(0):               " + AIStation.GetName(0));
10381
4ad8b98acd82 (svn r12922) [NoAI] -Add: added AIStation::SetName() (Yexo)
truebrain
parents: 10370
diff changeset
   868
	print("  SetName(0):               " + AIStation.SetName(0, "Look, a station"));
4ad8b98acd82 (svn r12922) [NoAI] -Add: added AIStation::SetName() (Yexo)
truebrain
parents: 10370
diff changeset
   869
	print("  GetName(0):               " + AIStation.GetName(0));
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
   870
	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
   871
	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
   872
	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
   873
	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
   874
	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
   875
	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
   876
	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
   877
10668
495789401303 (svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents: 10650
diff changeset
   878
	print("  GetStationID(33411):      " + AIStation.GetStationID(33411));
495789401303 (svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents: 10650
diff changeset
   879
	print("  HasRoadType(3, TRAM):     " + AIStation.HasRoadType(3, AIRoad.ROADTYPE_TRAM));
495789401303 (svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents: 10650
diff changeset
   880
	print("  HasRoadType(3, ROAD):     " + AIStation.HasRoadType(3, AIRoad.ROADTYPE_ROAD));
495789401303 (svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents: 10650
diff changeset
   881
	print("  HasRoadType(33411, TRAM): " + AIRoad.HasRoadType(33411, AIRoad.ROADTYPE_TRAM));
495789401303 (svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents: 10650
diff changeset
   882
	print("  HasRoadType(33411, ROAD): " + AIRoad.HasRoadType(33411, AIRoad.ROADTYPE_ROAD));
10863
7b31d67e1553 (svn r13414) [NoAI] -Add: added AIStation::HasStationType(station_id, station_type) to check if a given station has a given station-type
truebrain
parents: 10859
diff changeset
   883
	print("  HasStationType(3, BUS):   " + AIStation.HasStationType(3, AIStation.STATION_BUS_STOP));
7b31d67e1553 (svn r13414) [NoAI] -Add: added AIStation::HasStationType(station_id, station_type) to check if a given station has a given station-type
truebrain
parents: 10859
diff changeset
   884
	print("  HasStationType(3, TRAIN): " + AIStation.HasStationType(3, AIStation.STATION_TRAIN));
10668
495789401303 (svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents: 10650
diff changeset
   885
10863
7b31d67e1553 (svn r13414) [NoAI] -Add: added AIStation::HasStationType(station_id, station_type) to check if a given station has a given station-type
truebrain
parents: 10859
diff changeset
   886
	print("  GetCoverageRadius(BUS):   " + AIStation.GetCoverageRadius(AIStation.STATION_BUS_STOP));
7b31d67e1553 (svn r13414) [NoAI] -Add: added AIStation::HasStationType(station_id, station_type) to check if a given station has a given station-type
truebrain
parents: 10859
diff changeset
   887
	print("  GetCoverageRadius(TRUCK): " + AIStation.GetCoverageRadius(AIStation.STATION_TRUCK_STOP));
7b31d67e1553 (svn r13414) [NoAI] -Add: added AIStation::HasStationType(station_id, station_type) to check if a given station has a given station-type
truebrain
parents: 10859
diff changeset
   888
	print("  GetCoverageRadius(TRAIN): " + AIStation.GetCoverageRadius(AIStation.STATION_TRAIN));
9670
820b77e19bb3 (svn r10609) [NoAI] -Add: added GetAirportWidth / GetAirportHeight
truelight
parents: 9668
diff changeset
   889
820b77e19bb3 (svn r10609) [NoAI] -Add: added GetAirportWidth / GetAirportHeight
truelight
parents: 9668
diff changeset
   890
	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
   891
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
   892
	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
   893
	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
   894
	print("  Count():             " + list.Count());
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   895
	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
   896
	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
   897
	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
   898
		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
   899
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   900
	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
   901
	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
   902
	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
   903
		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
   904
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   905
	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
   906
	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
   907
	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
   908
		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
   909
	}
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
   910
}
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
   911
9592
c5c09cfde63a (svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents: 9589
diff changeset
   912
function Regression::TileList()
c5c09cfde63a (svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents: 9589
diff changeset
   913
{
c5c09cfde63a (svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents: 9589
diff changeset
   914
	local list = AITileList();
c5c09cfde63a (svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents: 9589
diff changeset
   915
c5c09cfde63a (svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents: 9589
diff changeset
   916
	print("");
c5c09cfde63a (svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents: 9589
diff changeset
   917
	print("--TileList--");
c5c09cfde63a (svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents: 9589
diff changeset
   918
	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
   919
	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
   920
	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
   921
da75d1460a4b (svn r12722) [NoAI] -Add (or -Feature for yorick): added AITile::IsSteepSlope(), AITile::IsHalftileSlope() and AITile::GetComplementSlope()
truebrain
parents: 10187
diff changeset
   922
	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
   923
	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
   924
	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
   925
	print("  ListDump:");
da75d1460a4b (svn r12722) [NoAI] -Add (or -Feature for yorick): added AITile::IsSteepSlope(), AITile::IsHalftileSlope() and AITile::GetComplementSlope()
truebrain
parents: 10187
diff changeset
   926
	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
   927
		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
   928
		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
   929
		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
   930
		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
   931
	}
da75d1460a4b (svn r12722) [NoAI] -Add (or -Feature for yorick): added AITile::IsSteepSlope(), AITile::IsHalftileSlope() and AITile::GetComplementSlope()
truebrain
parents: 10187
diff changeset
   932
	list.Clear();
da75d1460a4b (svn r12722) [NoAI] -Add (or -Feature for yorick): added AITile::IsSteepSlope(), AITile::IsHalftileSlope() and AITile::GetComplementSlope()
truebrain
parents: 10187
diff changeset
   933
da75d1460a4b (svn r12722) [NoAI] -Add (or -Feature for yorick): added AITile::IsSteepSlope(), AITile::IsHalftileSlope() and AITile::GetComplementSlope()
truebrain
parents: 10187
diff changeset
   934
	print("");
da75d1460a4b (svn r12722) [NoAI] -Add (or -Feature for yorick): added AITile::IsSteepSlope(), AITile::IsHalftileSlope() and AITile::GetComplementSlope()
truebrain
parents: 10187
diff changeset
   935
	print("--TileList--");
da75d1460a4b (svn r12722) [NoAI] -Add (or -Feature for yorick): added AITile::IsSteepSlope(), AITile::IsHalftileSlope() and AITile::GetComplementSlope()
truebrain
parents: 10187
diff changeset
   936
	print("  Count():             " + list.Count());
9605
2c2348827b52 (svn r9749) [NoAI] -Add: added regression-test for new AITileList valuators
truelight
parents: 9592
diff changeset
   937
	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
   938
	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
   939
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   940
	list.Valuate(AITile.GetHeight);
9700
e442ce398e83 (svn r10941) [NoAI] -Add: added AITile::GetHeight and AITileList valuator Height
truelight
parents: 9699
diff changeset
   941
	print("  Height():            done");
e442ce398e83 (svn r10941) [NoAI] -Add: added AITile::GetHeight and AITileList valuator Height
truelight
parents: 9699
diff changeset
   942
	print("  Count():             " + list.Count());
e442ce398e83 (svn r10941) [NoAI] -Add: added AITile::GetHeight and AITileList valuator Height
truelight
parents: 9699
diff changeset
   943
	print("  ListDump:");
e442ce398e83 (svn r10941) [NoAI] -Add: added AITile::GetHeight and AITileList valuator Height
truelight
parents: 9699
diff changeset
   944
	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
   945
		print("    " + i + " => " + list.GetValue(i));
e442ce398e83 (svn r10941) [NoAI] -Add: added AITile::GetHeight and AITileList valuator Height
truelight
parents: 9699
diff changeset
   946
	}
e442ce398e83 (svn r10941) [NoAI] -Add: added AITile::GetHeight and AITileList valuator Height
truelight
parents: 9699
diff changeset
   947
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   948
	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
   949
	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
   950
	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
   951
	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
   952
	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
   953
	print("  ListDump:");
5cf58c6571b7 (svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents: 9609
diff changeset
   954
	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
   955
		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
   956
	}
5cf58c6571b7 (svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents: 9609
diff changeset
   957
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   958
	list.Valuate(AITile.IsBuildable);
9592
c5c09cfde63a (svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents: 9589
diff changeset
   959
	list.KeepValue(1);
9605
2c2348827b52 (svn r9749) [NoAI] -Add: added regression-test for new AITileList valuators
truelight
parents: 9592
diff changeset
   960
	print("  Buildable():         done");
9609
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9605
diff changeset
   961
	print("  KeepValue(1):        done");
9605
2c2348827b52 (svn r9749) [NoAI] -Add: added regression-test for new AITileList valuators
truelight
parents: 9592
diff changeset
   962
	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
   963
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   964
	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
   965
	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
   966
	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
   967
		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
   968
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   969
	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
   970
	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
   971
	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
   972
		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
   973
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   974
	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
   975
	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
   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
	}
10360
3234cb59de55 (svn r12901) [NoAI] -Add: added AITown.IsWithinTownRadius, AIStation.IsWithinTownRadius and AITile.GetOwner (Yexo)
truebrain
parents: 10344
diff changeset
   979
	list.Valuate(AITile.GetOwner);
3234cb59de55 (svn r12901) [NoAI] -Add: added AITown.IsWithinTownRadius, AIStation.IsWithinTownRadius and AITile.GetOwner (Yexo)
truebrain
parents: 10344
diff changeset
   980
	print("  GetOwner() ListDump:");
3234cb59de55 (svn r12901) [NoAI] -Add: added AITown.IsWithinTownRadius, AIStation.IsWithinTownRadius and AITile.GetOwner (Yexo)
truebrain
parents: 10344
diff changeset
   981
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
3234cb59de55 (svn r12901) [NoAI] -Add: added AITown.IsWithinTownRadius, AIStation.IsWithinTownRadius and AITile.GetOwner (Yexo)
truebrain
parents: 10344
diff changeset
   982
		print("    " + i + " => " + list.GetValue(i));
3234cb59de55 (svn r12901) [NoAI] -Add: added AITown.IsWithinTownRadius, AIStation.IsWithinTownRadius and AITile.GetOwner (Yexo)
truebrain
parents: 10344
diff changeset
   983
	}
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
   984
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   985
	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
   986
	list.KeepAboveValue(10);
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9605
diff changeset
   987
	print("  CargoAcceptance():   done");
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9605
diff changeset
   988
	print("  KeepAboveValue(10):  done");
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9605
diff changeset
   989
	print("  Count():             " + list.Count());
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9605
diff changeset
   990
	print("  ListDump:");
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9605
diff changeset
   991
	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
   992
		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
   993
	}
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9605
diff changeset
   994
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
   995
	list.Valuate(AIRoad.IsRoadTile);
9605
2c2348827b52 (svn r9749) [NoAI] -Add: added regression-test for new AITileList valuators
truelight
parents: 9592
diff changeset
   996
	list.KeepValue(1);
2c2348827b52 (svn r9749) [NoAI] -Add: added regression-test for new AITileList valuators
truelight
parents: 9592
diff changeset
   997
	print("  RoadTile():          done");
9609
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9605
diff changeset
   998
	print("  KeepValue(1):        done");
9605
2c2348827b52 (svn r9749) [NoAI] -Add: added regression-test for new AITileList valuators
truelight
parents: 9592
diff changeset
   999
	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
  1000
	print("  ListDump:");
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9605
diff changeset
  1001
	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
  1002
		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
  1003
	}
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9605
diff changeset
  1004
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
  1005
	list.Valuate(AIRoad.GetNeighbourRoadCount);
9605
2c2348827b52 (svn r9749) [NoAI] -Add: added regression-test for new AITileList valuators
truelight
parents: 9592
diff changeset
  1006
	list.KeepValue(1);
9617
df9cedf12aab (svn r9786) [NoAI] -Fix: NeighbourRoad -> NeighbourRoadCount
truelight
parents: 9616
diff changeset
  1007
	print("  NeighbourRoadCount():done");
9609
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9605
diff changeset
  1008
	print("  KeepValue(1):        done");
9592
c5c09cfde63a (svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents: 9589
diff changeset
  1009
	print("  Count():             " + list.Count());
c5c09cfde63a (svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents: 9589
diff changeset
  1010
	print("  ListDump:");
c5c09cfde63a (svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents: 9589
diff changeset
  1011
	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
  1012
		print("    " + i + " => " + list.GetValue(i));
c5c09cfde63a (svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents: 9589
diff changeset
  1013
	}
9698
1d50fe99b7e9 (svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents: 9696
diff changeset
  1014
1d50fe99b7e9 (svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents: 9696
diff changeset
  1015
	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
  1016
	list.Valuate(AITile.IsWater);
9698
1d50fe99b7e9 (svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents: 9696
diff changeset
  1017
	print("  Water():             done");
1d50fe99b7e9 (svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents: 9696
diff changeset
  1018
	print("  Count():             " + list.Count());
1d50fe99b7e9 (svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents: 9696
diff changeset
  1019
	print("  ListDump:");
1d50fe99b7e9 (svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents: 9696
diff changeset
  1020
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
1d50fe99b7e9 (svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents: 9696
diff changeset
  1021
		print("    " + i + " => " + list.GetValue(i));
1d50fe99b7e9 (svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents: 9696
diff changeset
  1022
	}
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
  1023
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
  1024
	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
  1025
	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
  1026
	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
  1027
	print("  Count():             " + list.Count());
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
  1028
	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
  1029
	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
  1030
	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
  1031
		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
  1032
	}
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
  1033
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
  1034
	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
  1035
	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
  1036
	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
  1037
	print("  Count():             " + list.Count());
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
  1038
	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
  1039
	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
  1040
	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
  1041
		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
  1042
	}
10864
9a6616a1dce6 (svn r13415) [NoAI] -Add: added AITileList_StationType, giving all the tiles on which a station of your requested type is, for a given station
truebrain
parents: 10863
diff changeset
  1043
9a6616a1dce6 (svn r13415) [NoAI] -Add: added AITileList_StationType, giving all the tiles on which a station of your requested type is, for a given station
truebrain
parents: 10863
diff changeset
  1044
	local list = AITileList_StationType(3, AIStation.STATION_BUS_STOP);
9a6616a1dce6 (svn r13415) [NoAI] -Add: added AITileList_StationType, giving all the tiles on which a station of your requested type is, for a given station
truebrain
parents: 10863
diff changeset
  1045
	print("");
9a6616a1dce6 (svn r13415) [NoAI] -Add: added AITileList_StationType, giving all the tiles on which a station of your requested type is, for a given station
truebrain
parents: 10863
diff changeset
  1046
	print("--TileList_StationType--");
9a6616a1dce6 (svn r13415) [NoAI] -Add: added AITileList_StationType, giving all the tiles on which a station of your requested type is, for a given station
truebrain
parents: 10863
diff changeset
  1047
	print("  Count():             " + list.Count());
9a6616a1dce6 (svn r13415) [NoAI] -Add: added AITileList_StationType, giving all the tiles on which a station of your requested type is, for a given station
truebrain
parents: 10863
diff changeset
  1048
	print("  Location ListDump:");
9a6616a1dce6 (svn r13415) [NoAI] -Add: added AITileList_StationType, giving all the tiles on which a station of your requested type is, for a given station
truebrain
parents: 10863
diff changeset
  1049
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
9a6616a1dce6 (svn r13415) [NoAI] -Add: added AITileList_StationType, giving all the tiles on which a station of your requested type is, for a given station
truebrain
parents: 10863
diff changeset
  1050
		print("    " + i + " => " + list.GetValue(i));
9a6616a1dce6 (svn r13415) [NoAI] -Add: added AITileList_StationType, giving all the tiles on which a station of your requested type is, for a given station
truebrain
parents: 10863
diff changeset
  1051
	}
9592
c5c09cfde63a (svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents: 9589
diff changeset
  1052
}
c5c09cfde63a (svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents: 9589
diff changeset
  1053
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
  1054
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
  1055
{
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
  1056
	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
  1057
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
  1058
	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
  1059
	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
  1060
	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
  1061
	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
  1062
	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
  1063
		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
  1064
		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
  1065
		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
  1066
		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
  1067
		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
  1068
		print("    GetLocation():   " + AITown.GetLocation(i));
10844
affb2821fb9f (svn r13395) [NoAI] -Fix [API CHANGE]: Rename AIOrder::GetNumberOfORders to AIOrder::GetOrderCount
truebrain
parents: 10831
diff changeset
  1069
		print("    GetHouseCount(): " + AITown.GetHouseCount(i));
10869
4fdb11e1b599 (svn r13420) [NoAI] -Add: function to get the town rating.
rubidium
parents: 10864
diff changeset
  1070
		print("    GetRating():     " + AITown.GetRating(i, AICompany.MY_COMPANY));
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
  1071
	}
9511
f767ad06e86b (svn r9407) [NoAI] -Add: placing of signs.
rubidium
parents: 9492
diff changeset
  1072
	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
  1073
	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
  1074
}
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
  1075
9589
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents: 9585
diff changeset
  1076
function Regression::TownList()
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents: 9585
diff changeset
  1077
{
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents: 9585
diff changeset
  1078
	local list = AITownList();
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents: 9585
diff changeset
  1079
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents: 9585
diff changeset
  1080
	print("");
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents: 9585
diff changeset
  1081
	print("--TownList--");
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents: 9585
diff changeset
  1082
	print("  Count():             " + list.Count());
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
  1083
	list.Valuate(AITown.GetLocation);
9649
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
  1084
	print("  Location ListDump:");
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
  1085
	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
  1086
		print("    " + i + " => " + list.GetValue(i));
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
  1087
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
  1088
	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
  1089
	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
  1090
	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
  1091
		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
  1092
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
  1093
	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
  1094
	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
  1095
	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
  1096
		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
  1097
	}
10361
4cdffd48480f (svn r12902) [NoAI] -Fix r12901 [API CHANGE]: renamed IsWithinTownRadius to IsWithinTownInfluence, as that reflects the meaning much better
truebrain
parents: 10360
diff changeset
  1098
	list.Valuate(AITown.IsWithinTownInfluence, AITown.GetLocation(0));
4cdffd48480f (svn r12902) [NoAI] -Fix r12901 [API CHANGE]: renamed IsWithinTownRadius to IsWithinTownInfluence, as that reflects the meaning much better
truebrain
parents: 10360
diff changeset
  1099
	print("  IsWithinTownInfluence(" + AITown.GetLocation(0) + ") ListDump:");
10360
3234cb59de55 (svn r12901) [NoAI] -Add: added AITown.IsWithinTownRadius, AIStation.IsWithinTownRadius and AITile.GetOwner (Yexo)
truebrain
parents: 10344
diff changeset
  1100
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
3234cb59de55 (svn r12901) [NoAI] -Add: added AITown.IsWithinTownRadius, AIStation.IsWithinTownRadius and AITile.GetOwner (Yexo)
truebrain
parents: 10344
diff changeset
  1101
		print("    " + i + " => " + list.GetValue(i));
3234cb59de55 (svn r12901) [NoAI] -Add: added AITown.IsWithinTownRadius, AIStation.IsWithinTownRadius and AITile.GetOwner (Yexo)
truebrain
parents: 10344
diff changeset
  1102
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
  1103
	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
  1104
	list.KeepAboveValue(500);
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents: 9585
diff changeset
  1105
	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
  1106
	print("  Count():             " + list.Count());
9649
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
  1107
	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
  1108
	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
  1109
		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
  1110
	}
10859
4c14a8041c0a (svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents: 10856
diff changeset
  1111
4c14a8041c0a (svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents: 10856
diff changeset
  1112
	print("  HasStatue():                     " + AITown.HasStatue(list.Begin()));
4c14a8041c0a (svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents: 10856
diff changeset
  1113
	print("  GetRoadReworkDuration():         " + AITown.GetRoadReworkDuration(list.Begin()));
4c14a8041c0a (svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents: 10856
diff changeset
  1114
	print("  GetExclusiveRightsPlayer():      " + AITown.GetExclusiveRightsPlayer(list.Begin()));
4c14a8041c0a (svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents: 10856
diff changeset
  1115
	print("  GetExclusiveRightsDuration():    " + AITown.GetExclusiveRightsDuration(list.Begin()));
4c14a8041c0a (svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents: 10856
diff changeset
  1116
	print("  IsActionAvailable(BUILD_STATUE): " + AITown.IsActionAvailable(list.Begin(), AITown.TOWN_ACTION_BUILD_STATUE));
4c14a8041c0a (svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents: 10856
diff changeset
  1117
	print("  PerformTownAction(BUILD_STATUE): " + AITown.PerformTownAction(list.Begin(), AITown.TOWN_ACTION_BUILD_STATUE));
4c14a8041c0a (svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents: 10856
diff changeset
  1118
	print("  IsActionAvailable(BUILD_STATUE): " + AITown.IsActionAvailable(list.Begin(), AITown.TOWN_ACTION_BUILD_STATUE));
4c14a8041c0a (svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents: 10856
diff changeset
  1119
	print("  HasStatue():                     " + AITown.HasStatue(list.Begin()));
9589
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents: 9585
diff changeset
  1120
}
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents: 9585
diff changeset
  1121
9794
5d866d7cb991 (svn r12298) [NoAI] -Add: added AITunnel (Morloth)
truebrain
parents: 9793
diff changeset
  1122
function Regression::Tunnel()
5d866d7cb991 (svn r12298) [NoAI] -Add: added AITunnel (Morloth)
truebrain
parents: 9793
diff changeset
  1123
{
10859
4c14a8041c0a (svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents: 10856
diff changeset
  1124
	print("");
4c14a8041c0a (svn r13410) [NoAI] -Add: functions to perform town actions (advertising, bribing, building statues, etc).
rubidium
parents: 10856
diff changeset
  1125
	print("--Tunnel--");
9794
5d866d7cb991 (svn r12298) [NoAI] -Add: added AITunnel (Morloth)
truebrain
parents: 9793
diff changeset
  1126
	print("  IsTunnelTile():       " + AITunnel.IsTunnelTile(29050));
5d866d7cb991 (svn r12298) [NoAI] -Add: added AITunnel (Morloth)
truebrain
parents: 9793
diff changeset
  1127
	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
  1128
	print("  GetOtherTunnelEnd():  " + AITunnel.GetOtherTunnelEnd(29050));
9794
5d866d7cb991 (svn r12298) [NoAI] -Add: added AITunnel (Morloth)
truebrain
parents: 9793
diff changeset
  1129
	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
  1130
	print("  GetOtherTunnelEnd():  " + AITunnel.GetOtherTunnelEnd(29050));
9794
5d866d7cb991 (svn r12298) [NoAI] -Add: added AITunnel (Morloth)
truebrain
parents: 9793
diff changeset
  1131
	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
  1132
	print("  IsTunnelTile():       " + AITunnel.IsTunnelTile(28026));
9794
5d866d7cb991 (svn r12298) [NoAI] -Add: added AITunnel (Morloth)
truebrain
parents: 9793
diff changeset
  1133
	print("  RemoveTunnel():       " + AITunnel.RemoveTunnel(29050));
5d866d7cb991 (svn r12298) [NoAI] -Add: added AITunnel (Morloth)
truebrain
parents: 9793
diff changeset
  1134
	print("  IsTunnelTile():       " + AITunnel.IsTunnelTile(29050));
10088
922c6e6a8d3e (svn r12612) [NoAI] -Add: support for GetLastError for AITunnel. Patch by Morloth.
rubidium
parents: 10086
diff changeset
  1135
922c6e6a8d3e (svn r12612) [NoAI] -Add: support for GetLastError for AITunnel. Patch by Morloth.
rubidium
parents: 10086
diff changeset
  1136
	print("  --Errors--");
922c6e6a8d3e (svn r12612) [NoAI] -Add: support for GetLastError for AITunnel. Patch by Morloth.
rubidium
parents: 10086
diff changeset
  1137
	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
  1138
	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
  1139
	print("  GetLastErrorString(): " + AIError.GetLastErrorString());
922c6e6a8d3e (svn r12612) [NoAI] -Add: support for GetLastError for AITunnel. Patch by Morloth.
rubidium
parents: 10086
diff changeset
  1140
	print("  RemoveTunnel():       " + AITunnel.RemoveTunnel(7529));
9794
5d866d7cb991 (svn r12298) [NoAI] -Add: added AITunnel (Morloth)
truebrain
parents: 9793
diff changeset
  1141
}
5d866d7cb991 (svn r12298) [NoAI] -Add: added AITunnel (Morloth)
truebrain
parents: 9793
diff changeset
  1142
9518
b32191854ad9 (svn r9432) [NoAI] -Add: added regression-test for AIVehicle()
truelight
parents: 9511
diff changeset
  1143
function Regression::Vehicle()
b32191854ad9 (svn r9432) [NoAI] -Add: added regression-test for AIVehicle()
truelight
parents: 9511
diff changeset
  1144
{
9557
a3e1a25cf3d3 (svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents: 9555
diff changeset
  1145
	local accounting = AIAccounting();
9518
b32191854ad9 (svn r9432) [NoAI] -Add: added regression-test for AIVehicle()
truelight
parents: 9511
diff changeset
  1146
b32191854ad9 (svn r9432) [NoAI] -Add: added regression-test for AIVehicle()
truelight
parents: 9511
diff changeset
  1147
	print("");
b32191854ad9 (svn r9432) [NoAI] -Add: added regression-test for AIVehicle()
truelight
parents: 9511
diff changeset
  1148
	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
  1149
	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
  1150
	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
  1151
	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
  1152
	print("  ISValidVehicle(9999): " + AIVehicle.IsValidVehicle(9999));
9518
b32191854ad9 (svn r9432) [NoAI] -Add: added regression-test for AIVehicle()
truelight
parents: 9511
diff changeset
  1153
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
  1154
	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
  1155
9560
ff2dde050a4c (svn r9498) [NoAI] -Add: added regression for AITransactionMode()
truelight
parents: 9558
diff changeset
  1156
	{
ff2dde050a4c (svn r9498) [NoAI] -Add: added regression for AITransactionMode()
truelight
parents: 9558
diff changeset
  1157
		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
  1158
		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
  1159
		print("  IsValidVehicle(11):   " + AIVehicle.IsValidVehicle(11));
9560
ff2dde050a4c (svn r9498) [NoAI] -Add: added regression for AITransactionMode()
truelight
parents: 9558
diff changeset
  1160
ff2dde050a4c (svn r9498) [NoAI] -Add: added regression for AITransactionMode()
truelight
parents: 9558
diff changeset
  1161
		print("  --Transaction--");
ff2dde050a4c (svn r9498) [NoAI] -Add: added regression for AITransactionMode()
truelight
parents: 9558
diff changeset
  1162
		print("    GetCosts():         " + transaction.GetCosts());
ff2dde050a4c (svn r9498) [NoAI] -Add: added regression for AITransactionMode()
truelight
parents: 9558
diff changeset
  1163
		print("    Execute():          " + transaction.Execute());
ff2dde050a4c (svn r9498) [NoAI] -Add: added regression for AITransactionMode()
truelight
parents: 9558
diff changeset
  1164
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
  1165
		print("  IsValidVehicle(11):   " + AIVehicle.IsValidVehicle(11));
9560
ff2dde050a4c (svn r9498) [NoAI] -Add: added regression for AITransactionMode()
truelight
parents: 9558
diff changeset
  1166
	}
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
  1167
	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
  1168
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
  1169
	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
  1170
a3e1a25cf3d3 (svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents: 9555
diff changeset
  1171
	print("  --Accounting--");
a3e1a25cf3d3 (svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents: 9555
diff changeset
  1172
	print("    GetCosts():         " + accounting.GetCosts());
a3e1a25cf3d3 (svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents: 9555
diff changeset
  1173
	print("    Should be:          " + (bank - bank_after));
a3e1a25cf3d3 (svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents: 9555
diff changeset
  1174
	print("    ResetCosts():       " + accounting.ResetCosts());
a3e1a25cf3d3 (svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents: 9555
diff changeset
  1175
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
  1176
	bank = AICompany.GetBankBalance(AICompany.MY_COMPANY);
9557
a3e1a25cf3d3 (svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents: 9555
diff changeset
  1177
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
  1178
	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
  1179
	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
  1180
	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
  1181
	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
  1182
	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
  1183
	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
  1184
	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
  1185
	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
  1186
	print("  IsStoppedInDepot():   " + AIVehicle.IsStoppedInDepot(11));
9557
a3e1a25cf3d3 (svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents: 9555
diff changeset
  1187
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
  1188
	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
  1189
a3e1a25cf3d3 (svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents: 9555
diff changeset
  1190
	print("  --Accounting--");
a3e1a25cf3d3 (svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents: 9555
diff changeset
  1191
	print("    GetCosts():         " + accounting.GetCosts());
a3e1a25cf3d3 (svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents: 9555
diff changeset
  1192
	print("    Should be:          " + (bank - bank_after));
a3e1a25cf3d3 (svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents: 9555
diff changeset
  1193
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
  1194
	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
  1195
	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
  1196
	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
  1197
	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
  1198
9615
f809cdc8e360 (svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents: 9614
diff changeset
  1199
	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
  1200
	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
  1201
	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
  1202
	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
  1203
	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
  1204
	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
  1205
	print("    GetAgeLeft():        " + AIVehicle.GetAgeLeft(11));
10187
d5a6eba5af45 (svn r12718) [NoAI] -Add: added AIVehicle::GetCurrentSpeed
truebrain
parents: 10088
diff changeset
  1206
	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
  1207
	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
  1208
	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
  1209
	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
  1210
	print("    GetVehicleType():    " + AIVehicle.GetVehicleType(11));
10668
495789401303 (svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents: 10650
diff changeset
  1211
	print("    GetRoadType():       " + AIVehicle.GetRoadType(11));
10193
9f73edc0c57a (svn r12724) [NoAI] -Fix r12720: also add regression test for new functions
truebrain
parents: 10191
diff changeset
  1212
	print("    GetCapacity():       " + AIVehicle.GetCapacity(11, 10));
9f73edc0c57a (svn r12724) [NoAI] -Fix r12720: also add regression test for new functions
truebrain
parents: 10191
diff changeset
  1213
	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
  1214
	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
  1215
	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
  1216
10360
3234cb59de55 (svn r12901) [NoAI] -Add: added AITown.IsWithinTownRadius, AIStation.IsWithinTownRadius and AITile.GetOwner (Yexo)
truebrain
parents: 10344
diff changeset
  1217
	print("  GetOwner():           " + AITile.GetOwner(32119));
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
  1218
	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
  1219
	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
  1220
	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
  1221
	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
  1222
	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
  1223
	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
  1224
	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
  1225
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
  1226
	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
  1227
	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
  1228
	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
  1229
	print("  IsStoppedInDepot(15): " + AIVehicle.IsStoppedInDepot(15));
9654
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9652
diff changeset
  1230
9874
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9867
diff changeset
  1231
	print("  --Errors--");
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9867
diff changeset
  1232
	print("    RefitVehicle():        " + AIVehicle.RefitVehicle(11, 0));
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9867
diff changeset
  1233
	print("    GetLastErrorString():  " + AIError.GetLastErrorString());
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9867
diff changeset
  1234
	print("    SellVehicle():         " + AIVehicle.SellVehicle(11));
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9867
diff changeset
  1235
	print("    GetLastErrorString():  " + AIError.GetLastErrorString());
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9867
diff changeset
  1236
	print("    SendVehicleToDepot():  " + AIVehicle.SendVehicleToDepot(12));
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9867
diff changeset
  1237
	print("    GetLastErrorString():  " + AIError.GetLastErrorString());
4ecef0dadf01 (svn r12607) [NoAI] -Add: SetLastError support for AIVehicle (Morloth)
truebrain
parents: 9867
diff changeset
  1238
9614
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1239
	local list = AIVehicleList();
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1240
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1241
	print("");
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1242
	print("--VehicleList--");
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1243
	print("  Count():             " + list.Count());
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
  1244
	list.Valuate(AIVehicle.GetLocation);
9614
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1245
	print("  Location ListDump:");
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1246
	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
  1247
		print("    " + i + " => " + list.GetValue(i));
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1248
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
  1249
	list.Valuate(AIVehicle.GetEngineType);
9614
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1250
	print("  EngineType ListDump:");
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1251
	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
  1252
		print("    " + i + " => " + list.GetValue(i));
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1253
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
  1254
	list.Valuate(AIVehicle.GetUnitNumber);
9614
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1255
	print("  UnitNumber ListDump:");
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1256
	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
  1257
		print("    " + i + " => " + list.GetValue(i));
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1258
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
  1259
	list.Valuate(AIVehicle.GetAge);
9614
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1260
	print("  Age ListDump:");
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1261
	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
  1262
		print("    " + i + " => " + list.GetValue(i));
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1263
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
  1264
	list.Valuate(AIVehicle.GetMaxAge);
9614
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1265
	print("  MaxAge ListDump:");
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1266
	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
  1267
		print("    " + i + " => " + list.GetValue(i));
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1268
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
  1269
	list.Valuate(AIVehicle.GetAgeLeft);
9614
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1270
	print("  AgeLeft ListDump:");
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1271
	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
  1272
		print("    " + i + " => " + list.GetValue(i));
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1273
	}
10187
d5a6eba5af45 (svn r12718) [NoAI] -Add: added AIVehicle::GetCurrentSpeed
truebrain
parents: 10088
diff changeset
  1274
	list.Valuate(AIVehicle.GetCurrentSpeed);
d5a6eba5af45 (svn r12718) [NoAI] -Add: added AIVehicle::GetCurrentSpeed
truebrain
parents: 10088
diff changeset
  1275
	print("  CurrentSpeed ListDump:");
d5a6eba5af45 (svn r12718) [NoAI] -Add: added AIVehicle::GetCurrentSpeed
truebrain
parents: 10088
diff changeset
  1276
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
d5a6eba5af45 (svn r12718) [NoAI] -Add: added AIVehicle::GetCurrentSpeed
truebrain
parents: 10088
diff changeset
  1277
		print("    " + i + " => " + list.GetValue(i));
d5a6eba5af45 (svn r12718) [NoAI] -Add: added AIVehicle::GetCurrentSpeed
truebrain
parents: 10088
diff changeset
  1278
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
  1279
	list.Valuate(AIVehicle.GetRunningCost);
9806
d65cc2bcb0de (svn r12312) [NoAI] -Fix: AIVehicle_vRunningCost didn't exist
truebrain
parents: 9801
diff changeset
  1280
	print("  RunningCost ListDump:");
d65cc2bcb0de (svn r12312) [NoAI] -Fix: AIVehicle_vRunningCost didn't exist
truebrain
parents: 9801
diff changeset
  1281
	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
  1282
		print("    " + i + " => " + list.GetValue(i));
d65cc2bcb0de (svn r12312) [NoAI] -Fix: AIVehicle_vRunningCost didn't exist
truebrain
parents: 9801
diff changeset
  1283
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
  1284
	list.Valuate(AIVehicle.GetProfitThisYear);
9614
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1285
	print("  ProfitThisYear ListDump:");
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1286
	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
  1287
		print("    " + i + " => " + list.GetValue(i));
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1288
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
  1289
	list.Valuate(AIVehicle.GetProfitLastYear);
9614
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1290
	print("  ProfitLastYear ListDump:");
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1291
	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
  1292
		print("    " + i + " => " + list.GetValue(i));
814c3bbf8ecc (svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents: 9611
diff changeset
  1293
	}
9814
be51ea0adc29 (svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents: 9810
diff changeset
  1294
	list.Valuate(AIVehicle.GetVehicleType);
9684
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9682
diff changeset
  1295
	print("  VehicleType ListDump:");
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9682
diff changeset
  1296
	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
  1297
		print("    " + i + " => " + list.GetValue(i));
623970482fb2 (svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents: 9682
diff changeset
  1298
	}
10668
495789401303 (svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents: 10650
diff changeset
  1299
	list.Valuate(AIVehicle.GetRoadType);
495789401303 (svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents: 10650
diff changeset
  1300
	print("  RoadType ListDump:");
495789401303 (svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents: 10650
diff changeset
  1301
	for (local i = list.Begin(); list.HasNext(); i = list.Next()) {
495789401303 (svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents: 10650
diff changeset
  1302
		print("    " + i + " => " + list.GetValue(i));
495789401303 (svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents: 10650
diff changeset
  1303
	}
10193
9f73edc0c57a (svn r12724) [NoAI] -Fix r12720: also add regression test for new functions
truebrain
parents: 10191
diff changeset
  1304
	list.Valuate(AIVehicle.GetCapacity, 10);
9f73edc0c57a (svn r12724) [NoAI] -Fix r12720: also add regression test for new functions
truebrain
parents: 10191
diff changeset
  1305
	print("  VehicleType ListDump:");
9f73edc0c57a (svn r12724) [NoAI] -Fix r12720: also add regression test for new functions
truebrain
parents: 10191
diff changeset
  1306
	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
  1307
		print("    " + i + " => " + list.GetValue(i));
9f73edc0c57a (svn r12724) [NoAI] -Fix r12720: also add regression test for new functions
truebrain
parents: 10191
diff changeset
  1308
	}
9f73edc0c57a (svn r12724) [NoAI] -Fix r12720: also add regression test for new functions
truebrain
parents: 10191
diff changeset
  1309
	list.Valuate(AIVehicle.GetCargoLoad, 10);
9f73edc0c57a (svn r12724) [NoAI] -Fix r12720: also add regression test for new functions
truebrain
parents: 10191
diff changeset
  1310
	print("  VehicleType ListDump:");
9f73edc0c57a (svn r12724) [NoAI] -Fix r12720: also add regression test for new functions
truebrain
parents: 10191
diff changeset
  1311
	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
  1312
		print("    " + i + " => " + list.GetValue(i));
9f73edc0c57a (svn r12724) [NoAI] -Fix r12720: also add regression test for new functions
truebrain
parents: 10191
diff changeset
  1313
	}
9518
b32191854ad9 (svn r9432) [NoAI] -Add: added regression-test for AIVehicle()
truelight
parents: 9511
diff changeset
  1314
}
b32191854ad9 (svn r9432) [NoAI] -Add: added regression-test for AIVehicle()
truelight
parents: 9511
diff changeset
  1315
10344
b7e9f5c65e30 (svn r12885) [NoAI] -Add: added AISubsidy and AIEventSubsidyNNN (Yexo)
truebrain
parents: 10291
diff changeset
  1316
function Regression::PrintSubsidy(subsidy_id)
b7e9f5c65e30 (svn r12885) [NoAI] -Add: added AISubsidy and AIEventSubsidyNNN (Yexo)
truebrain
parents: 10291
diff changeset
  1317
{
b7e9f5c65e30 (svn r12885) [NoAI] -Add: added AISubsidy and AIEventSubsidyNNN (Yexo)
truebrain
parents: 10291
diff changeset
  1318
	print("      --Subsidy (" + subsidy_id + ") --");
b7e9f5c65e30 (svn r12885) [NoAI] -Add: added AISubsidy and AIEventSubsidyNNN (Yexo)
truebrain
parents: 10291
diff changeset
  1319
	print("        IsValidSubsidy():     " + AISubsidy.IsValidSubsidy(subsidy_id));
b7e9f5c65e30 (svn r12885) [NoAI] -Add: added AISubsidy and AIEventSubsidyNNN (Yexo)
truebrain
parents: 10291
diff changeset
  1320
	print("        IsAwarded():          " + AISubsidy.IsAwarded(subsidy_id));
b7e9f5c65e30 (svn r12885) [NoAI] -Add: added AISubsidy and AIEventSubsidyNNN (Yexo)
truebrain
parents: 10291
diff changeset
  1321
	print("        GetAwardedTo():       " + AISubsidy.GetAwardedTo(subsidy_id));
b7e9f5c65e30 (svn r12885) [NoAI] -Add: added AISubsidy and AIEventSubsidyNNN (Yexo)
truebrain
parents: 10291
diff changeset
  1322
	print("        GetExpireDate():      " + AISubsidy.GetExpireDate(subsidy_id));
b7e9f5c65e30 (svn r12885) [NoAI] -Add: added AISubsidy and AIEventSubsidyNNN (Yexo)
truebrain
parents: 10291
diff changeset
  1323
	print("        SourceIsTown():       " + AISubsidy.SourceIsTown(subsidy_id));
b7e9f5c65e30 (svn r12885) [NoAI] -Add: added AISubsidy and AIEventSubsidyNNN (Yexo)
truebrain
parents: 10291
diff changeset
  1324
	print("        GetSource():          " + AISubsidy.GetSource(subsidy_id));
b7e9f5c65e30 (svn r12885) [NoAI] -Add: added AISubsidy and AIEventSubsidyNNN (Yexo)
truebrain
parents: 10291
diff changeset
  1325
	print("        DestionationIsTown(): " + AISubsidy.DestinationIsTown(subsidy_id));
b7e9f5c65e30 (svn r12885) [NoAI] -Add: added AISubsidy and AIEventSubsidyNNN (Yexo)
truebrain
parents: 10291
diff changeset
  1326
	print("        GetDestionation():    " + AISubsidy.GetDestination(subsidy_id));
b7e9f5c65e30 (svn r12885) [NoAI] -Add: added AISubsidy and AIEventSubsidyNNN (Yexo)
truebrain
parents: 10291
diff changeset
  1327
	print("        GetCargoType():       " + AISubsidy.GetCargoType(subsidy_id));
b7e9f5c65e30 (svn r12885) [NoAI] -Add: added AISubsidy and AIEventSubsidyNNN (Yexo)
truebrain
parents: 10291
diff changeset
  1328
}
b7e9f5c65e30 (svn r12885) [NoAI] -Add: added AISubsidy and AIEventSubsidyNNN (Yexo)
truebrain
parents: 10291
diff changeset
  1329
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
  1330
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
  1331
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
  1332
{
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
  1333
	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
  1334
	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
  1335
	this.Base();
9691
1231d4e5f5aa (svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents: 9684
diff changeset
  1336
	this.List();
9654
b836eb5c521f (svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents: 9652
diff changeset
  1337
	this.Airport();
9792
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
  1338
	this.Bridge();
e1222f4674c2 (svn r12294) [NoAI] -Add: added AIBridge(List), which lists all available bridges (no build yet)
truebrain
parents: 9791
diff changeset
  1339
	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
  1340
	this.Cargo();
9785
edbd185e05ed (svn r12280) [NoAI] -Add: added AICargoList (Morloth)
truebrain
parents: 9776
diff changeset
  1341
	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
  1342
	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
  1343
	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
  1344
	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
  1345
	this.Event();
10910
85f71706f496 (svn r13461) [NoAI] -Fix: add A* to regression, so we test it a bit (very basic test ;))
truebrain
parents: 10904
diff changeset
  1346
	this.Graph();
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
  1347
	this.Industry();
9649
bc8c06513f5b (svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents: 9648
diff changeset
  1348
	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
  1349
	this.Map();
9691
1231d4e5f5aa (svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents: 9684
diff changeset
  1350
	this.Marine();
10896
6bb839ed0002 (svn r13447) [NoAI] -Add [Library]: Binary Heap ( O(ln n) insert/pop )
truebrain
parents: 10889
diff changeset
  1351
	this.Queues();
9485
df09b849ca60 (svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents: 9470
diff changeset
  1352
	this.Road();
9511
f767ad06e86b (svn r9407) [NoAI] -Add: placing of signs.
rubidium
parents: 9492
diff changeset
  1353
	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
  1354
	this.Station();
9592
c5c09cfde63a (svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents: 9589
diff changeset
  1355
	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
  1356
	this.Town();
9589
2fbda08db406 (svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents: 9585
diff changeset
  1357
	this.TownList();
9794
5d866d7cb991 (svn r12298) [NoAI] -Add: added AITunnel (Morloth)
truebrain
parents: 9793
diff changeset
  1358
	this.Tunnel();
9518
b32191854ad9 (svn r9432) [NoAI] -Add: added regression-test for AIVehicle()
truelight
parents: 9511
diff changeset
  1359
	this.Vehicle();
9546
fde20f518285 (svn r9477) [NoAI] -Add: added regression-test for AIOrder()
truelight
parents: 9541
diff changeset
  1360
	/* Order has to be after Vehicle */
fde20f518285 (svn r9477) [NoAI] -Add: added regression-test for AIOrder()
truelight
parents: 9541
diff changeset
  1361
	this.Order();
10344
b7e9f5c65e30 (svn r12885) [NoAI] -Add: added AISubsidy and AIEventSubsidyNNN (Yexo)
truebrain
parents: 10291
diff changeset
  1362
	PrintSubsidy(0);
9823
0b7f816cf46f (svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents: 9814
diff changeset
  1363
0b7f816cf46f (svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents: 9814
diff changeset
  1364
	/* 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
  1365
	Sleep(4000);
0b7f816cf46f (svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents: 9814
diff changeset
  1366
0b7f816cf46f (svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents: 9814
diff changeset
  1367
	while (AIEventController.IsEventWaiting()) {
0b7f816cf46f (svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents: 9814
diff changeset
  1368
		local e = AIEventController.GetNextEvent();
0b7f816cf46f (svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents: 9814
diff changeset
  1369
		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
  1370
		print("    GetEventType:        " + e.GetEventType());
0b7f816cf46f (svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents: 9814
diff changeset
  1371
		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
  1372
			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
  1373
				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
  1374
				print("      EventName:         SubsidyOffer");
10344
b7e9f5c65e30 (svn r12885) [NoAI] -Add: added AISubsidy and AIEventSubsidyNNN (Yexo)
truebrain
parents: 10291
diff changeset
  1375
				PrintSubsidy(c.GetSubsidyID());
9823
0b7f816cf46f (svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents: 9814
diff changeset
  1376
				break;
0b7f816cf46f (svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents: 9814
diff changeset
  1377
10370
fa4f88090694 (svn r12911) [NoAI] -Add: added AIEventVehicle(List|WaitingInDepot|Unprofitable) (Yexo)
truebrain
parents: 10361
diff changeset
  1378
			case AIEvent.AI_ET_VEHICLE_WAITING_IN_DEPOT:
fa4f88090694 (svn r12911) [NoAI] -Add: added AIEventVehicle(List|WaitingInDepot|Unprofitable) (Yexo)
truebrain
parents: 10361
diff changeset
  1379
				local c = AIEventVehicleWaitingInDepot.Convert(e);
fa4f88090694 (svn r12911) [NoAI] -Add: added AIEventVehicle(List|WaitingInDepot|Unprofitable) (Yexo)
truebrain
parents: 10361
diff changeset
  1380
				print("      EventName:         VehicleWaitingInDepot");
fa4f88090694 (svn r12911) [NoAI] -Add: added AIEventVehicle(List|WaitingInDepot|Unprofitable) (Yexo)
truebrain
parents: 10361
diff changeset
  1381
				print("      VehicleID:         " + c.GetVehicleID());
fa4f88090694 (svn r12911) [NoAI] -Add: added AIEventVehicle(List|WaitingInDepot|Unprofitable) (Yexo)
truebrain
parents: 10361
diff changeset
  1382
				break;
fa4f88090694 (svn r12911) [NoAI] -Add: added AIEventVehicle(List|WaitingInDepot|Unprofitable) (Yexo)
truebrain
parents: 10361
diff changeset
  1383
9823
0b7f816cf46f (svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents: 9814
diff changeset
  1384
			default:
0b7f816cf46f (svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents: 9814
diff changeset
  1385
				print("      Unknown Event");
0b7f816cf46f (svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents: 9814
diff changeset
  1386
				break;
0b7f816cf46f (svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents: 9814
diff changeset
  1387
		}
0b7f816cf46f (svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents: 9814
diff changeset
  1388
	}
0b7f816cf46f (svn r12431) [NoAI] -Add: added AIEventSubsidiaryOffer, which keeps you informed about new Subsidiaries
truebrain
parents: 9814
diff changeset
  1389
	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
  1390
}
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
  1391