author | truebrain |
Sun, 24 Feb 2008 22:13:24 +0000 | |
branch | noai |
changeset 9754 | ec106fe84b72 |
parent 9753 | 7209db94ad12 |
child 9757 | 5cdc14959fb6 |
permissions | -rw-r--r-- |
9460
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
1 |
class Regression extends AIController { |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
2 |
stop = false; |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
3 |
|
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
4 |
function Start(); |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
5 |
function Stop(); |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
6 |
} |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
7 |
|
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
8 |
|
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
9 |
|
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
10 |
function Regression::TestInit() |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
11 |
{ |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
12 |
print(""); |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
13 |
print("--TestInit--"); |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
14 |
print(" TickTest: " + this.GetTick()); |
9557
a3e1a25cf3d3
(svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents:
9555
diff
changeset
|
15 |
this.Sleep(1); |
9460
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
16 |
print(" TickTest: " + this.GetTick()); |
9749
ee414c031e73
(svn r12229) [NoAI] -Fix: AISetting()s functions can be static too
truebrain
parents:
9745
diff
changeset
|
17 |
print(" SetCommandDelay: " + AISettings.SetCommandDelay(1)); |
9460
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
18 |
} |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
19 |
|
9487
0575126e0267
(svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents:
9485
diff
changeset
|
20 |
function Regression::Std() |
0575126e0267
(svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents:
9485
diff
changeset
|
21 |
{ |
0575126e0267
(svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents:
9485
diff
changeset
|
22 |
print(""); |
0575126e0267
(svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents:
9485
diff
changeset
|
23 |
print("--Std--"); |
0575126e0267
(svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents:
9485
diff
changeset
|
24 |
print(" abs(-21): " + abs(-21)); |
0575126e0267
(svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents:
9485
diff
changeset
|
25 |
print(" abs( 21): " + abs(21)); |
0575126e0267
(svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents:
9485
diff
changeset
|
26 |
} |
0575126e0267
(svn r9356) [NoAI] -Add: add abs() function to global scope in SQ. This means we now have an own squirrel_std class which registers such functions. (on request by Zuu)
truelight
parents:
9485
diff
changeset
|
27 |
|
9460
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
28 |
function Regression::Base() |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
29 |
{ |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
30 |
print(""); |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
31 |
print("--AIBase--"); |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
32 |
print(" Rand(): " + AIBase.Rand()); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
33 |
print(" Rand(): " + AIBase.Rand()); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
34 |
print(" Rand(): " + AIBase.Rand()); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
35 |
print(" RandRange(0): " + AIBase.RandRange(0)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
36 |
print(" RandRange(0): " + AIBase.RandRange(0)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
37 |
print(" RandRange(0): " + AIBase.RandRange(0)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
38 |
print(" RandRange(1): " + AIBase.RandRange(1)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
39 |
print(" RandRange(1): " + AIBase.RandRange(1)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
40 |
print(" RandRange(1): " + AIBase.RandRange(1)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
41 |
print(" RandRange(2): " + AIBase.RandRange(2)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
42 |
print(" RandRange(2): " + AIBase.RandRange(2)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
43 |
print(" RandRange(2): " + AIBase.RandRange(2)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
44 |
print(" RandRange(9): " + AIBase.RandRange(9)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
45 |
print(" RandRange(9): " + AIBase.RandRange(9)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
46 |
print(" RandRange(9): " + AIBase.RandRange(9)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
47 |
print(" Chance(1, 2): " + AIBase.Chance(1, 2)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
48 |
print(" Chance(1, 2): " + AIBase.Chance(1, 2)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
49 |
print(" Chance(1, 2): " + AIBase.Chance(1, 2)); |
9460
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
50 |
} |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
51 |
|
9654
b836eb5c521f
(svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
9652
diff
changeset
|
52 |
function Regression::Airport() |
b836eb5c521f
(svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
9652
diff
changeset
|
53 |
{ |
b836eb5c521f
(svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
9652
diff
changeset
|
54 |
print(""); |
b836eb5c521f
(svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
9652
diff
changeset
|
55 |
print("--AIAirport--"); |
b836eb5c521f
(svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
9652
diff
changeset
|
56 |
|
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
57 |
print(" IsHangarTile(): " + AIAirport.IsHangarTile(32116)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
58 |
print(" IsAirportTile(): " + AIAirport.IsAirportTile(32116)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
59 |
print(" GetHangarOfAirport(): " + AIAirport.GetHangarOfAirport(32116)); |
9654
b836eb5c521f
(svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
9652
diff
changeset
|
60 |
|
b836eb5c521f
(svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
9652
diff
changeset
|
61 |
for (local i = -1; i < 10; i++) { |
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
|
62 |
print(" AiportAvailable(" + i + "): " + AIAirport.AiportAvailable(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
|
63 |
print(" GetAirportWidth(" + i + "): " + AIAirport.GetAirportWidth(i)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
64 |
print(" GetAirportHeight(" + i + "): " + AIAirport.GetAirportHeight(i)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
65 |
print(" GetAirportCoverageRadius(" + i + "): " + AIAirport.GetAirportCoverageRadius(i)); |
9654
b836eb5c521f
(svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
9652
diff
changeset
|
66 |
} |
b836eb5c521f
(svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
9652
diff
changeset
|
67 |
|
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
68 |
print(" GetBankBalance(): " + AICompany.GetBankBalance(AICompany.MY_COMPANY)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
69 |
print(" BuildAirport(): " + AIAirport.BuildAirport(32116, 0)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
70 |
print(" IsHangarTile(): " + AIAirport.IsHangarTile(32116)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
71 |
print(" IsAirportTile(): " + AIAirport.IsAirportTile(32116)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
72 |
print(" GetHangarOfAirport(): " + AIAirport.GetHangarOfAirport(32116)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
73 |
print(" IsHangarTile(): " + AIAirport.IsHangarTile(32119)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
74 |
print(" IsAirportTile(): " + AIAirport.IsAirportTile(32119)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
75 |
print(" GetBankBalance(): " + AICompany.GetBankBalance(AICompany.MY_COMPANY)); |
9654
b836eb5c521f
(svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
9652
diff
changeset
|
76 |
|
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
77 |
print(" RemoveAirport(): " + AIAirport.RemoveAirport(32118)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
78 |
print(" IsHangarTile(): " + AIAirport.IsHangarTile(32119)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
79 |
print(" IsAirportTile(): " + AIAirport.IsAirportTile(32119)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
80 |
print(" GetBankBalance(): " + AICompany.GetBankBalance(AICompany.MY_COMPANY)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
81 |
print(" BuildAirport(): " + AIAirport.BuildAirport(32116, 0)); |
9654
b836eb5c521f
(svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
9652
diff
changeset
|
82 |
} |
b836eb5c521f
(svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
9652
diff
changeset
|
83 |
|
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
|
84 |
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
|
85 |
{ |
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
|
86 |
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
|
87 |
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
|
88 |
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
|
89 |
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
|
90 |
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
|
91 |
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
|
92 |
print(" IsFreight(): " + AICargo.IsFreight(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
|
93 |
print(" GetCargoIncome(0, 0): " + AICargo.GetCargoIncome(0, 0, 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
|
94 |
print(" GetCargoIncome(10, 10): " + AICargo.GetCargoIncome(10, 10, 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
|
95 |
print(" GetCargoIncome(100, 10): " + AICargo.GetCargoIncome(100, 10, 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
|
96 |
print(" GetCargoIncome(10, 100): " + AICargo.GetCargoIncome(10, 100, i)); |
9460
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
97 |
} |
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
|
98 |
} |
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
|
99 |
|
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
|
100 |
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
|
101 |
{ |
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
|
102 |
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
|
103 |
print("--Company--"); |
9558
4fc9b464a932
(svn r9496) [NoAI] -Add: added regression for AITestMode() and AIExecMode()
truelight
parents:
9557
diff
changeset
|
104 |
|
4fc9b464a932
(svn r9496) [NoAI] -Add: added regression for AITestMode() and AIExecMode()
truelight
parents:
9557
diff
changeset
|
105 |
/* Test AIXXXMode() in scopes */ |
4fc9b464a932
(svn r9496) [NoAI] -Add: added regression for AITestMode() and AIExecMode()
truelight
parents:
9557
diff
changeset
|
106 |
{ |
4fc9b464a932
(svn r9496) [NoAI] -Add: added regression for AITestMode() and AIExecMode()
truelight
parents:
9557
diff
changeset
|
107 |
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
|
108 |
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
|
109 |
print(" SetCompanyName(): " + AICompany.SetCompanyName("Regression")); |
9558
4fc9b464a932
(svn r9496) [NoAI] -Add: added regression for AITestMode() and AIExecMode()
truelight
parents:
9557
diff
changeset
|
110 |
{ |
4fc9b464a932
(svn r9496) [NoAI] -Add: added regression for AITestMode() and AIExecMode()
truelight
parents:
9557
diff
changeset
|
111 |
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
|
112 |
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
|
113 |
print(" SetCompanyName(): " + AICompany.SetCompanyName("Regression")); |
9558
4fc9b464a932
(svn r9496) [NoAI] -Add: added regression for AITestMode() and AIExecMode()
truelight
parents:
9557
diff
changeset
|
114 |
} |
4fc9b464a932
(svn r9496) [NoAI] -Add: added regression for AITestMode() and AIExecMode()
truelight
parents:
9557
diff
changeset
|
115 |
} |
4fc9b464a932
(svn r9496) [NoAI] -Add: added regression for AITestMode() and AIExecMode()
truelight
parents:
9557
diff
changeset
|
116 |
|
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
|
117 |
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
|
118 |
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
|
119 |
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
|
120 |
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
|
121 |
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
|
122 |
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
|
123 |
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
|
124 |
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
|
125 |
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
|
126 |
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
|
127 |
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
|
128 |
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
|
129 |
print(" SetLoanAmount(10000): " + AICompany.SetLoanAmount(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
|
130 |
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
|
131 |
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
|
132 |
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
|
133 |
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
|
134 |
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
|
135 |
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
|
136 |
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
|
137 |
print(" GetLoanAmount(): " + AICompany.GetLoanAmount()); |
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
|
138 |
} |
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
|
139 |
|
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
|
140 |
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
|
141 |
{ |
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
|
142 |
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
|
143 |
|
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
|
144 |
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
|
145 |
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
|
146 |
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
|
147 |
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
|
148 |
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
|
149 |
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
|
150 |
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
|
151 |
print(" GetCargoType(): " + AIEngine.GetCargoType(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
|
152 |
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
|
153 |
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
|
154 |
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
|
155 |
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
|
156 |
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
|
157 |
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
|
158 |
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
|
159 |
print(" GetVehicleType(): " + AIEngine.GetVehicleType(i)); |
9711
c8b427215c9d
(svn r11295) [NoAI] -Change [API CHANGE]: put Engine things in AIEngine, and rename functions as such. Most noticable: FindBestXXXVehicle -> FineBestXXXEngine
truelight
parents:
9710
diff
changeset
|
160 |
} |
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
|
161 |
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
|
162 |
} |
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
|
163 |
|
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
|
164 |
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
|
165 |
{ |
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
|
166 |
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
|
167 |
|
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
|
168 |
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
|
169 |
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
|
170 |
print(" Count(): " + list.Count()); |
9753
7209db94ad12
(svn r12236) [NoAI] -Change: [API CHANGE] All valuators are now in the notation: AI<type>List_v<Valuator>. Example: AIVehicleList_vAge
truebrain
parents:
9749
diff
changeset
|
171 |
list.Valuate(AIEngineList_vCargoType()); |
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
|
172 |
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
|
173 |
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
|
174 |
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
|
175 |
} |
9753
7209db94ad12
(svn r12236) [NoAI] -Change: [API CHANGE] All valuators are now in the notation: AI<type>List_v<Valuator>. Example: AIVehicleList_vAge
truebrain
parents:
9749
diff
changeset
|
176 |
list.Valuate(AIEngineList_vCapacity()); |
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
|
177 |
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
|
178 |
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
|
179 |
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
|
180 |
} |
9753
7209db94ad12
(svn r12236) [NoAI] -Change: [API CHANGE] All valuators are now in the notation: AI<type>List_v<Valuator>. Example: AIVehicleList_vAge
truebrain
parents:
9749
diff
changeset
|
181 |
list.Valuate(AIEngineList_vReliability()); |
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
|
182 |
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
|
183 |
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
|
184 |
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
|
185 |
} |
9753
7209db94ad12
(svn r12236) [NoAI] -Change: [API CHANGE] All valuators are now in the notation: AI<type>List_v<Valuator>. Example: AIVehicleList_vAge
truebrain
parents:
9749
diff
changeset
|
186 |
list.Valuate(AIEngineList_vMaxSpeed()); |
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
|
187 |
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
|
188 |
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
|
189 |
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
|
190 |
} |
9753
7209db94ad12
(svn r12236) [NoAI] -Change: [API CHANGE] All valuators are now in the notation: AI<type>List_v<Valuator>. Example: AIVehicleList_vAge
truebrain
parents:
9749
diff
changeset
|
191 |
list.Valuate(AIEngineList_vPrice()); |
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
|
192 |
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
|
193 |
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
|
194 |
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
|
195 |
} |
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
|
196 |
} |
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
|
197 |
|
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
|
198 |
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
|
199 |
{ |
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
|
200 |
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
|
201 |
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
|
202 |
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
|
203 |
local e = AIEventController.GetNextEvent(); |
9684
623970482fb2
(svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents:
9682
diff
changeset
|
204 |
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
|
205 |
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
|
206 |
local c = AIEventTest.Convert(e); |
9684
623970482fb2
(svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents:
9682
diff
changeset
|
207 |
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
|
208 |
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
|
209 |
|
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
|
210 |
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
|
211 |
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
|
212 |
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
|
213 |
e = AIEventController.GetNextEvent(); |
9684
623970482fb2
(svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents:
9682
diff
changeset
|
214 |
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
|
215 |
|
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
|
216 |
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
|
217 |
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
|
218 |
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
|
219 |
e = AIEventController.GetNextEvent(); |
9684
623970482fb2
(svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents:
9682
diff
changeset
|
220 |
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
|
221 |
|
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
|
222 |
{ |
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
|
223 |
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
|
224 |
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
|
225 |
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
|
226 |
e = AIEventController.GetNextEvent(); |
9684
623970482fb2
(svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents:
9682
diff
changeset
|
227 |
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
|
228 |
} |
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
|
229 |
|
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
|
230 |
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
|
231 |
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
|
232 |
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
|
233 |
e = AIEventController.GetNextEvent(); |
9684
623970482fb2
(svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents:
9682
diff
changeset
|
234 |
print(" GetNextEvent: " + (e == null ? "null" : "instance")); |
623970482fb2
(svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents:
9682
diff
changeset
|
235 |
e = AIEventController.GetNextEvent(); |
623970482fb2
(svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents:
9682
diff
changeset
|
236 |
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
|
237 |
} |
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
|
238 |
|
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
|
239 |
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
|
240 |
{ |
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
|
241 |
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
|
242 |
|
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
|
243 |
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
|
244 |
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
|
245 |
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
|
246 |
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
|
247 |
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
|
248 |
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
|
249 |
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
|
250 |
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
|
251 |
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
|
252 |
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
|
253 |
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
|
254 |
print(" IsCargoAccepted(): " + AIIndustry.IsCargoAccepted(i, 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
|
255 |
} |
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
|
256 |
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
|
257 |
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
|
258 |
} |
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
|
259 |
|
9649
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
260 |
function Regression::IndustryList() |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
261 |
{ |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
262 |
local list = AIIndustryList(); |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
263 |
|
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
264 |
print(""); |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
265 |
print("--IndustryList--"); |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
266 |
print(" Count(): " + list.Count()); |
9753
7209db94ad12
(svn r12236) [NoAI] -Change: [API CHANGE] All valuators are now in the notation: AI<type>List_v<Valuator>. Example: AIVehicleList_vAge
truebrain
parents:
9749
diff
changeset
|
267 |
list.Valuate(AIIndustryList_vLocation()); |
9649
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
268 |
print(" Location ListDump:"); |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
269 |
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
|
270 |
print(" " + i + " => " + list.GetValue(i)); |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
271 |
} |
9753
7209db94ad12
(svn r12236) [NoAI] -Change: [API CHANGE] All valuators are now in the notation: AI<type>List_v<Valuator>. Example: AIVehicleList_vAge
truebrain
parents:
9749
diff
changeset
|
272 |
list.Valuate(AIIndustryList_vDistanceManhattanToTile(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
|
273 |
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
|
274 |
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
|
275 |
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
|
276 |
} |
9753
7209db94ad12
(svn r12236) [NoAI] -Change: [API CHANGE] All valuators are now in the notation: AI<type>List_v<Valuator>. Example: AIVehicleList_vAge
truebrain
parents:
9749
diff
changeset
|
277 |
list.Valuate(AIIndustryList_vDistanceSquareToTile(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
|
278 |
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
|
279 |
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
|
280 |
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
|
281 |
} |
9753
7209db94ad12
(svn r12236) [NoAI] -Change: [API CHANGE] All valuators are now in the notation: AI<type>List_v<Valuator>. Example: AIVehicleList_vAge
truebrain
parents:
9749
diff
changeset
|
282 |
list.Valuate(AIIndustryList_vCargoAccepted(1)); |
9710
ba44f8c1fd52
(svn r11294) [NoAI] -Add: added AIIndustry::IsCargoAccepted + Valuator (on request by Kilinich)
truelight
parents:
9709
diff
changeset
|
283 |
print(" CargoAccepted(1) ListDump:"); |
ba44f8c1fd52
(svn r11294) [NoAI] -Add: added AIIndustry::IsCargoAccepted + Valuator (on request by Kilinich)
truelight
parents:
9709
diff
changeset
|
284 |
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
|
285 |
print(" " + i + " => " + list.GetValue(i)); |
ba44f8c1fd52
(svn r11294) [NoAI] -Add: added AIIndustry::IsCargoAccepted + Valuator (on request by Kilinich)
truelight
parents:
9709
diff
changeset
|
286 |
} |
9753
7209db94ad12
(svn r12236) [NoAI] -Change: [API CHANGE] All valuators are now in the notation: AI<type>List_v<Valuator>. Example: AIVehicleList_vAge
truebrain
parents:
9749
diff
changeset
|
287 |
list.Valuate(AIIndustryList_vProduction(1)); |
9649
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
288 |
list.KeepAboveValue(50); |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
289 |
print(" KeepAboveValue(50): done"); |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
290 |
print(" Count(): " + list.Count()); |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
291 |
print(" Production ListDump:"); |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
292 |
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
|
293 |
print(" " + i + " => " + list.GetValue(i)); |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
294 |
} |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
295 |
} |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
296 |
|
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
|
297 |
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
|
298 |
{ |
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
|
299 |
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
|
300 |
|
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
|
301 |
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
|
302 |
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
|
303 |
|
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
|
304 |
print(" IsEmpty(): " + list.IsEmpty()); |
9664
c5741021bf59
(svn r10577) [NoAI] -Add: added ChangeItem to AIList
truelight
parents:
9660
diff
changeset
|
305 |
list.AddItem(1, 1); |
c5741021bf59
(svn r10577) [NoAI] -Add: added ChangeItem to AIList
truelight
parents:
9660
diff
changeset
|
306 |
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
|
307 |
for (local i = 1000; i < 1100; i++) { |
9664
c5741021bf59
(svn r10577) [NoAI] -Add: added ChangeItem to AIList
truelight
parents:
9660
diff
changeset
|
308 |
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
|
309 |
} |
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
|
310 |
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
|
311 |
list.RemoveItem(1150); |
9664
c5741021bf59
(svn r10577) [NoAI] -Add: added ChangeItem to AIList
truelight
parents:
9660
diff
changeset
|
312 |
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
|
313 |
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
|
314 |
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
|
315 |
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
|
316 |
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
|
317 |
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
|
318 |
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
|
319 |
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
|
320 |
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
|
321 |
} |
9753
7209db94ad12
(svn r12236) [NoAI] -Change: [API CHANGE] All valuators are now in the notation: AI<type>List_v<Valuator>. Example: AIVehicleList_vAge
truebrain
parents:
9749
diff
changeset
|
322 |
list.Valuate(AIList_vRandomize()); |
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
|
323 |
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
|
324 |
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
|
325 |
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
|
326 |
} |
9665
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
327 |
|
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
328 |
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
|
329 |
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
|
330 |
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
|
331 |
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
|
332 |
} |
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
333 |
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
|
334 |
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
|
335 |
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
|
336 |
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
|
337 |
} |
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
338 |
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
|
339 |
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
|
340 |
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
|
341 |
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
|
342 |
} |
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
343 |
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
|
344 |
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
|
345 |
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
|
346 |
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
|
347 |
} |
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
348 |
|
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
349 |
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
|
350 |
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
|
351 |
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
|
352 |
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
|
353 |
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
|
354 |
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
|
355 |
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
|
356 |
} |
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
357 |
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
|
358 |
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
|
359 |
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
|
360 |
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
|
361 |
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
|
362 |
} |
e889ac1e663a
(svn r10579) [NoAI] -Add: functions to remove/keep the top/bottom X items from a list.
rubidium
parents:
9664
diff
changeset
|
363 |
|
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
|
364 |
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
|
365 |
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
|
366 |
} |
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
|
367 |
|
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
|
368 |
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
|
369 |
{ |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
370 |
print(""); |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
371 |
print("--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
|
372 |
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
|
373 |
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
|
374 |
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
|
375 |
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
|
376 |
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
|
377 |
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
|
378 |
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
|
379 |
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
|
380 |
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
|
381 |
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
|
382 |
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
|
383 |
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
|
384 |
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
|
385 |
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
|
386 |
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
|
387 |
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
|
388 |
print(" IsValidTile(): " + AIMap.IsValidTile(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
|
389 |
print(" IsValidTile(): " + AIMap.IsValidTile(AIMap.GetMapSize() - 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
|
390 |
print(" DemolishTile(): " + AIMap.DemolishTile(19592)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
391 |
print(" DemolishTile(): " + AIMap.DemolishTile(19335)); |
9492
1aeee24046d8
(svn r9362) [NoAI] -Add: added the new AIMap() functions to regression-test
truelight
parents:
9487
diff
changeset
|
392 |
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
|
393 |
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
|
394 |
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
|
395 |
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
|
396 |
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
|
397 |
} |
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 |
|
9691
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
9684
diff
changeset
|
399 |
function Regression::Marine() |
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
9684
diff
changeset
|
400 |
{ |
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
9684
diff
changeset
|
401 |
print(""); |
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
9684
diff
changeset
|
402 |
print("--AIMarine--"); |
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
9684
diff
changeset
|
403 |
|
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
|
404 |
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
|
405 |
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
|
406 |
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
|
407 |
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
|
408 |
print(" IsCanalTile(): " + AIMarine.IsCanalTile(32116)); |
9691
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
9684
diff
changeset
|
409 |
|
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
|
410 |
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
|
411 |
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
|
412 |
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
|
413 |
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
|
414 |
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
|
415 |
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
|
416 |
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
|
417 |
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
|
418 |
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
|
419 |
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
|
420 |
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
|
421 |
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
|
422 |
|
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
|
423 |
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
|
424 |
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
|
425 |
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
|
426 |
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
|
427 |
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
|
428 |
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
|
429 |
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
|
430 |
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
|
431 |
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
|
432 |
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
|
433 |
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
|
434 |
|
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
|
435 |
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
|
436 |
print(" BuildDock(): " + AIMarine.BuildDock(29253)); |
9691
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
9684
diff
changeset
|
437 |
} |
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
9684
diff
changeset
|
438 |
|
9546
fde20f518285
(svn r9477) [NoAI] -Add: added regression-test for AIOrder()
truelight
parents:
9541
diff
changeset
|
439 |
function Regression::Order() |
fde20f518285
(svn r9477) [NoAI] -Add: added regression-test for AIOrder()
truelight
parents:
9541
diff
changeset
|
440 |
{ |
fde20f518285
(svn r9477) [NoAI] -Add: added regression-test for AIOrder()
truelight
parents:
9541
diff
changeset
|
441 |
print(""); |
fde20f518285
(svn r9477) [NoAI] -Add: added regression-test for AIOrder()
truelight
parents:
9541
diff
changeset
|
442 |
print("--Order--"); |
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
443 |
print(" GetNumberOfOrders(): " + AIOrder.GetNumberOfOrders(11)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
444 |
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
|
445 |
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
|
446 |
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
|
447 |
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
|
448 |
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
|
449 |
print(" InsertOrder(): " + AIOrder.InsertOrder(11, 0, 33416, AIOrder.AIOF_TRANSFER)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
450 |
print(" GetNumberOfOrders(): " + AIOrder.GetNumberOfOrders(11)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
451 |
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
|
452 |
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
|
453 |
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
|
454 |
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
|
455 |
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
|
456 |
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
|
457 |
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
|
458 |
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
|
459 |
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
|
460 |
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
|
461 |
|
9745
fb2454d70f37
(svn r12225) [NoAI] -Change [API CHANGE]: AIStationVehicleList -> AIVehicleList_Station (WATCH THE NAMES CAREFULLY!)
truebrain
parents:
9737
diff
changeset
|
462 |
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
|
463 |
|
25126afa0c25
(svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents:
9638
diff
changeset
|
464 |
print(""); |
9745
fb2454d70f37
(svn r12225) [NoAI] -Change [API CHANGE]: AIStationVehicleList -> AIVehicleList_Station (WATCH THE NAMES CAREFULLY!)
truebrain
parents:
9737
diff
changeset
|
465 |
print("--StationList_Vehicle--"); |
9645
25126afa0c25
(svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents:
9638
diff
changeset
|
466 |
print(" Count(): " + list.Count()); |
9753
7209db94ad12
(svn r12236) [NoAI] -Change: [API CHANGE] All valuators are now in the notation: AI<type>List_v<Valuator>. Example: AIVehicleList_vAge
truebrain
parents:
9749
diff
changeset
|
467 |
list.Valuate(AIStationList_vLocation()); |
9645
25126afa0c25
(svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents:
9638
diff
changeset
|
468 |
print(" Location ListDump:"); |
25126afa0c25
(svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents:
9638
diff
changeset
|
469 |
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
|
470 |
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
|
471 |
} |
9753
7209db94ad12
(svn r12236) [NoAI] -Change: [API CHANGE] All valuators are now in the notation: AI<type>List_v<Valuator>. Example: AIVehicleList_vAge
truebrain
parents:
9749
diff
changeset
|
472 |
list.Valuate(AIStationList_vCargoWaiting(0)); |
9645
25126afa0c25
(svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents:
9638
diff
changeset
|
473 |
print(" CargoWaiting(0) ListDump:"); |
25126afa0c25
(svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents:
9638
diff
changeset
|
474 |
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
|
475 |
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
|
476 |
} |
9753
7209db94ad12
(svn r12236) [NoAI] -Change: [API CHANGE] All valuators are now in the notation: AI<type>List_v<Valuator>. Example: AIVehicleList_vAge
truebrain
parents:
9749
diff
changeset
|
477 |
list.Valuate(AIStationList_vCargoWaiting(1)); |
9645
25126afa0c25
(svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents:
9638
diff
changeset
|
478 |
print(" CargoWaiting(1) ListDump:"); |
25126afa0c25
(svn r10538) [NoAI] -Add: added AIVehicleStationList, which lists all stations a vehicle goes to
truelight
parents:
9638
diff
changeset
|
479 |
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
|
480 |
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
|
481 |
} |
9753
7209db94ad12
(svn r12236) [NoAI] -Change: [API CHANGE] All valuators are now in the notation: AI<type>List_v<Valuator>. Example: AIVehicleList_vAge
truebrain
parents:
9749
diff
changeset
|
482 |
list.Valuate(AIStationList_vCargoRating(1)); |
9648
760b7b504e37
(svn r10543) [NoAI] -Add: added AIStationListCargoRating as valuator for a station list
truelight
parents:
9647
diff
changeset
|
483 |
print(" CargoRating(1) ListDump:"); |
760b7b504e37
(svn r10543) [NoAI] -Add: added AIStationListCargoRating as valuator for a station list
truelight
parents:
9647
diff
changeset
|
484 |
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
|
485 |
print(" " + i + " => " + list.GetValue(i)); |
760b7b504e37
(svn r10543) [NoAI] -Add: added AIStationListCargoRating as valuator for a station list
truelight
parents:
9647
diff
changeset
|
486 |
} |
9753
7209db94ad12
(svn r12236) [NoAI] -Change: [API CHANGE] All valuators are now in the notation: AI<type>List_v<Valuator>. Example: AIVehicleList_vAge
truebrain
parents:
9749
diff
changeset
|
487 |
list.Valuate(AIStationList_vDistanceManhattanToTile(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
|
488 |
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
|
489 |
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
|
490 |
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
|
491 |
} |
9753
7209db94ad12
(svn r12236) [NoAI] -Change: [API CHANGE] All valuators are now in the notation: AI<type>List_v<Valuator>. Example: AIVehicleList_vAge
truebrain
parents:
9749
diff
changeset
|
492 |
list.Valuate(AIStationList_vDistanceSquareToTile(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
|
493 |
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
|
494 |
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
|
495 |
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
|
496 |
} |
9647
c17046b1b8a2
(svn r10540) [NoAI] -Add: added AIStationVehicleList, which lists all vehicles that go to a given station
truelight
parents:
9645
diff
changeset
|
497 |
|
9745
fb2454d70f37
(svn r12225) [NoAI] -Change [API CHANGE]: AIStationVehicleList -> AIVehicleList_Station (WATCH THE NAMES CAREFULLY!)
truebrain
parents:
9737
diff
changeset
|
498 |
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
|
499 |
|
c17046b1b8a2
(svn r10540) [NoAI] -Add: added AIStationVehicleList, which lists all vehicles that go to a given station
truelight
parents:
9645
diff
changeset
|
500 |
print(""); |
9745
fb2454d70f37
(svn r12225) [NoAI] -Change [API CHANGE]: AIStationVehicleList -> AIVehicleList_Station (WATCH THE NAMES CAREFULLY!)
truebrain
parents:
9737
diff
changeset
|
501 |
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
|
502 |
print(" Count(): " + list.Count()); |
9753
7209db94ad12
(svn r12236) [NoAI] -Change: [API CHANGE] All valuators are now in the notation: AI<type>List_v<Valuator>. Example: AIVehicleList_vAge
truebrain
parents:
9749
diff
changeset
|
503 |
list.Valuate(AIVehicleList_vLocation()); |
9647
c17046b1b8a2
(svn r10540) [NoAI] -Add: added AIStationVehicleList, which lists all vehicles that go to a given station
truelight
parents:
9645
diff
changeset
|
504 |
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
|
505 |
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
|
506 |
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
|
507 |
} |
9546
fde20f518285
(svn r9477) [NoAI] -Add: added regression-test for AIOrder()
truelight
parents:
9541
diff
changeset
|
508 |
} |
fde20f518285
(svn r9477) [NoAI] -Add: added regression-test for AIOrder()
truelight
parents:
9541
diff
changeset
|
509 |
|
9652
c15bf5355b95
(svn r10553) [NoAI] -Add: added a framework for AIPathFinder() and implemented a really stupid AIPathFinderStupid()
truelight
parents:
9649
diff
changeset
|
510 |
function Regression::PathFinder() |
c15bf5355b95
(svn r10553) [NoAI] -Add: added a framework for AIPathFinder() and implemented a really stupid AIPathFinderStupid()
truelight
parents:
9649
diff
changeset
|
511 |
{ |
c15bf5355b95
(svn r10553) [NoAI] -Add: added a framework for AIPathFinder() and implemented a really stupid AIPathFinderStupid()
truelight
parents:
9649
diff
changeset
|
512 |
local pf = AIPathFinderStupid(AIPathFinder.PATHFINDER_ROAD); |
c15bf5355b95
(svn r10553) [NoAI] -Add: added a framework for AIPathFinder() and implemented a really stupid AIPathFinderStupid()
truelight
parents:
9649
diff
changeset
|
513 |
local start = AITileList(); |
c15bf5355b95
(svn r10553) [NoAI] -Add: added a framework for AIPathFinder() and implemented a really stupid AIPathFinderStupid()
truelight
parents:
9649
diff
changeset
|
514 |
local end = AITileList(); |
c15bf5355b95
(svn r10553) [NoAI] -Add: added a framework for AIPathFinder() and implemented a really stupid AIPathFinderStupid()
truelight
parents:
9649
diff
changeset
|
515 |
|
c15bf5355b95
(svn r10553) [NoAI] -Add: added a framework for AIPathFinder() and implemented a really stupid AIPathFinderStupid()
truelight
parents:
9649
diff
changeset
|
516 |
start.AddTile(33421); |
c15bf5355b95
(svn r10553) [NoAI] -Add: added a framework for AIPathFinder() and implemented a really stupid AIPathFinderStupid()
truelight
parents:
9649
diff
changeset
|
517 |
end.AddTile(33480 + 256 * 10); |
c15bf5355b95
(svn r10553) [NoAI] -Add: added a framework for AIPathFinder() and implemented a really stupid AIPathFinderStupid()
truelight
parents:
9649
diff
changeset
|
518 |
|
c15bf5355b95
(svn r10553) [NoAI] -Add: added a framework for AIPathFinder() and implemented a really stupid AIPathFinderStupid()
truelight
parents:
9649
diff
changeset
|
519 |
print(""); |
c15bf5355b95
(svn r10553) [NoAI] -Add: added a framework for AIPathFinder() and implemented a really stupid AIPathFinderStupid()
truelight
parents:
9649
diff
changeset
|
520 |
print("--PathFinderStupid--"); |
c15bf5355b95
(svn r10553) [NoAI] -Add: added a framework for AIPathFinder() and implemented a really stupid AIPathFinderStupid()
truelight
parents:
9649
diff
changeset
|
521 |
local ret = pf.FindRoute(start, end); |
c15bf5355b95
(svn r10553) [NoAI] -Add: added a framework for AIPathFinder() and implemented a really stupid AIPathFinderStupid()
truelight
parents:
9649
diff
changeset
|
522 |
print(" FindRoute(): " + (ret ? "Route Array" : "Nil")); |
c15bf5355b95
(svn r10553) [NoAI] -Add: added a framework for AIPathFinder() and implemented a really stupid AIPathFinderStupid()
truelight
parents:
9649
diff
changeset
|
523 |
print(" BuildRoute(): " + pf.BuildRoute(ret)); |
c15bf5355b95
(svn r10553) [NoAI] -Add: added a framework for AIPathFinder() and implemented a really stupid AIPathFinderStupid()
truelight
parents:
9649
diff
changeset
|
524 |
pf.FreeRoute(ret); |
c15bf5355b95
(svn r10553) [NoAI] -Add: added a framework for AIPathFinder() and implemented a really stupid AIPathFinderStupid()
truelight
parents:
9649
diff
changeset
|
525 |
|
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
|
526 |
print(" IsRoadTile(): " + AIRoad.IsRoadTile(33425)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
527 |
print(" IsRoadTile(): " + AIRoad.IsRoadTile(33480 + 256 * 5)); |
9652
c15bf5355b95
(svn r10553) [NoAI] -Add: added a framework for AIPathFinder() and implemented a really stupid AIPathFinderStupid()
truelight
parents:
9649
diff
changeset
|
528 |
} |
c15bf5355b95
(svn r10553) [NoAI] -Add: added a framework for AIPathFinder() and implemented a really stupid AIPathFinderStupid()
truelight
parents:
9649
diff
changeset
|
529 |
|
9485
df09b849ca60
(svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents:
9470
diff
changeset
|
530 |
function Regression::Road() |
df09b849ca60
(svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents:
9470
diff
changeset
|
531 |
{ |
df09b849ca60
(svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents:
9470
diff
changeset
|
532 |
print(""); |
df09b849ca60
(svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents:
9470
diff
changeset
|
533 |
print("--Road--"); |
df09b849ca60
(svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents:
9470
diff
changeset
|
534 |
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
|
535 |
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
|
536 |
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
|
537 |
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
|
538 |
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
|
539 |
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
|
540 |
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
|
541 |
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
|
542 |
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
|
543 |
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
|
544 |
print(" RemoveRoad(): " + AIRoad.RemoveRoad(19590, 19590)); |
9485
df09b849ca60
(svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents:
9470
diff
changeset
|
545 |
|
df09b849ca60
(svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents:
9470
diff
changeset
|
546 |
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
|
547 |
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
|
548 |
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
|
549 |
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
|
550 |
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
|
551 |
print(" BuildRoadDepot(): " + AIRoad.BuildRoadDepot(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
|
552 |
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
|
553 |
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
|
554 |
print(" IsRoadDepotTile(): " + AIRoad.IsRoadDepotTile(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
|
555 |
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
|
556 |
print(" RemoveRoadDepot(): " + AIRoad.RemoveRoadDepot(33411)); |
9485
df09b849ca60
(svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents:
9470
diff
changeset
|
557 |
|
df09b849ca60
(svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents:
9470
diff
changeset
|
558 |
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
|
559 |
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
|
560 |
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
|
561 |
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
|
562 |
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
|
563 |
print(" BuildRoadStation(): " + AIRoad.BuildRoadStation(33411, 33412, false, false)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
564 |
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
|
565 |
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
|
566 |
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
|
567 |
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
|
568 |
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
|
569 |
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
|
570 |
print(" RemoveRoadStation(): " + AIRoad.RemoveRoadStation(33411)); |
9485
df09b849ca60
(svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents:
9470
diff
changeset
|
571 |
|
df09b849ca60
(svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents:
9470
diff
changeset
|
572 |
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
|
573 |
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
|
574 |
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
|
575 |
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
|
576 |
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
|
577 |
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
|
578 |
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
|
579 |
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
|
580 |
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
|
581 |
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
|
582 |
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
|
583 |
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
|
584 |
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
|
585 |
print(" IsDriveThroughRoadStationTile: " + AIRoad.IsDriveThroughRoadStationTile(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
|
586 |
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
|
587 |
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
|
588 |
print(" IsRoadTile(): " + AIRoad.IsRoadTile(33415)); |
9485
df09b849ca60
(svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents:
9470
diff
changeset
|
589 |
} |
df09b849ca60
(svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents:
9470
diff
changeset
|
590 |
|
9511 | 591 |
function Regression::Sign() |
592 |
{ |
|
593 |
local j = 0; |
|
594 |
||
595 |
print(""); |
|
596 |
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
|
597 |
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
|
598 |
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
|
599 |
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
|
600 |
print(" RemoveSign(" + AISign_id + "): " + AISign.RemoveSign(AISign_id)); |
9511 | 601 |
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
|
602 |
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
|
603 |
print(" GetSignCount(): " + AISign.GetSignCount()); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
604 |
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
|
605 |
if (AISign.IsValidSign(i)) j++; |
9511 | 606 |
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
|
607 |
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
|
608 |
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
|
609 |
print(" GetLocation(): " + AISign.GetLocation(i)); |
9511 | 610 |
} |
611 |
print(" Valid Signs: " + j); |
|
9737
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
612 |
print(" GetSignCount(): " + AISign.GetSignCount()); |
9511 | 613 |
} |
614 |
||
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
|
615 |
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
|
616 |
{ |
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
|
617 |
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
|
618 |
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
|
619 |
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
|
620 |
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
|
621 |
print(" GetName(0): " + AIStation.GetName(0)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
622 |
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
|
623 |
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
|
624 |
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
|
625 |
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
|
626 |
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
|
627 |
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
|
628 |
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
|
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(" GetCoverageRadius(bus): " + AIStation.GetCoverageRadius(AIStation.STATION_BUS_STOP)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
631 |
print(" GetCoverageRadius(truck): " + AIStation.GetCoverageRadius(AIStation.STATION_TRUCK_STOP)); |
ee408edf3851
(svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents:
9733
diff
changeset
|
632 |
print(" GetCoverageRadius(train): " + AIStation.GetCoverageRadius(AIStation.STATION_TRAIN)); |
9670
820b77e19bb3
(svn r10609) [NoAI] -Add: added GetAirportWidth / GetAirportHeight
truelight
parents:
9668
diff
changeset
|
633 |
|
820b77e19bb3
(svn r10609) [NoAI] -Add: added GetAirportWidth / GetAirportHeight
truelight
parents:
9668
diff
changeset
|
634 |
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
|
635 |
|
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
|
636 |
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
|
637 |
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
|
638 |
print(" Count(): " + list.Count()); |
9753
7209db94ad12
(svn r12236) [NoAI] -Change: [API CHANGE] All valuators are now in the notation: AI<type>List_v<Valuator>. Example: AIVehicleList_vAge
truebrain
parents:
9749
diff
changeset
|
639 |
list.Valuate(AIStationList_vLocation()); |
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
|
640 |
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
|
641 |
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
|
642 |
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
|
643 |
} |
9753
7209db94ad12
(svn r12236) [NoAI] -Change: [API CHANGE] All valuators are now in the notation: AI<type>List_v<Valuator>. Example: AIVehicleList_vAge
truebrain
parents:
9749
diff
changeset
|
644 |
list.Valuate(AIStationList_vCargoWaiting(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
|
645 |
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
|
646 |
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
|
647 |
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
|
648 |
} |
9753
7209db94ad12
(svn r12236) [NoAI] -Change: [API CHANGE] All valuators are now in the notation: AI<type>List_v<Valuator>. Example: AIVehicleList_vAge
truebrain
parents:
9749
diff
changeset
|
649 |
list.Valuate(AIStationList_vCargoWaiting(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
|
650 |
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
|
651 |
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
|
652 |
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
|
653 |
} |
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
|
654 |
} |
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
|
655 |
|
9592
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
9589
diff
changeset
|
656 |
function Regression::TileList() |
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
9589
diff
changeset
|
657 |
{ |
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
9589
diff
changeset
|
658 |
local list = AITileList(); |
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
9589
diff
changeset
|
659 |
|
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
9589
diff
changeset
|
660 |
print(""); |
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
9589
diff
changeset
|
661 |
print("--TileList--"); |
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
9589
diff
changeset
|
662 |
print(" Count(): " + list.Count()); |
9605
2c2348827b52
(svn r9749) [NoAI] -Add: added regression-test for new AITileList valuators
truelight
parents:
9592
diff
changeset
|
663 |
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
|
664 |
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
|
665 |
|
9753
7209db94ad12
(svn r12236) [NoAI] -Change: [API CHANGE] All valuators are now in the notation: AI<type>List_v<Valuator>. Example: AIVehicleList_vAge
truebrain
parents:
9749
diff
changeset
|
666 |
list.Valuate(AITileList_vHeight()); |
9700
e442ce398e83
(svn r10941) [NoAI] -Add: added AITile::GetHeight and AITileList valuator Height
truelight
parents:
9699
diff
changeset
|
667 |
print(" Height(): done"); |
e442ce398e83
(svn r10941) [NoAI] -Add: added AITile::GetHeight and AITileList valuator Height
truelight
parents:
9699
diff
changeset
|
668 |
print(" Count(): " + list.Count()); |
e442ce398e83
(svn r10941) [NoAI] -Add: added AITile::GetHeight and AITileList valuator Height
truelight
parents:
9699
diff
changeset
|
669 |
print(" ListDump:"); |
e442ce398e83
(svn r10941) [NoAI] -Add: added AITile::GetHeight and AITileList valuator Height
truelight
parents:
9699
diff
changeset
|
670 |
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
|
671 |
print(" " + i + " => " + list.GetValue(i)); |
e442ce398e83
(svn r10941) [NoAI] -Add: added AITile::GetHeight and AITileList valuator Height
truelight
parents:
9699
diff
changeset
|
672 |
} |
e442ce398e83
(svn r10941) [NoAI] -Add: added AITile::GetHeight and AITileList valuator Height
truelight
parents:
9699
diff
changeset
|
673 |
|
9753
7209db94ad12
(svn r12236) [NoAI] -Change: [API CHANGE] All valuators are now in the notation: AI<type>List_v<Valuator>. Example: AIVehicleList_vAge
truebrain
parents:
9749
diff
changeset
|
674 |
list.Valuate(AITileList_vSlope()); |
9611
5cf58c6571b7
(svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents:
9609
diff
changeset
|
675 |
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
|
676 |
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
|
677 |
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
|
678 |
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
|
679 |
print(" ListDump:"); |
5cf58c6571b7
(svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents:
9609
diff
changeset
|
680 |
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
|
681 |
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
|
682 |
} |
5cf58c6571b7
(svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents:
9609
diff
changeset
|
683 |
|
9753
7209db94ad12
(svn r12236) [NoAI] -Change: [API CHANGE] All valuators are now in the notation: AI<type>List_v<Valuator>. Example: AIVehicleList_vAge
truebrain
parents:
9749
diff
changeset
|
684 |
list.Valuate(AITileList_vBuildable()); |
9592
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
9589
diff
changeset
|
685 |
list.KeepValue(1); |
9605
2c2348827b52
(svn r9749) [NoAI] -Add: added regression-test for new AITileList valuators
truelight
parents:
9592
diff
changeset
|
686 |
print(" Buildable(): done"); |
9609
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9605
diff
changeset
|
687 |
print(" KeepValue(1): done"); |
9605
2c2348827b52
(svn r9749) [NoAI] -Add: added regression-test for new AITileList valuators
truelight
parents:
9592
diff
changeset
|
688 |
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
|
689 |
|
9753
7209db94ad12
(svn r12236) [NoAI] -Change: [API CHANGE] All valuators are now in the notation: AI<type>List_v<Valuator>. Example: AIVehicleList_vAge
truebrain
parents:
9749
diff
changeset
|
690 |
list.Valuate(AITileList_vBuildableRectangle(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
|
691 |
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
|
692 |
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
|
693 |
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
|
694 |
} |
9753
7209db94ad12
(svn r12236) [NoAI] -Change: [API CHANGE] All valuators are now in the notation: AI<type>List_v<Valuator>. Example: AIVehicleList_vAge
truebrain
parents:
9749
diff
changeset
|
695 |
list.Valuate(AITileList_vDistanceManhattanToTile(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
|
696 |
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
|
697 |
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
|
698 |
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
|
699 |
} |
9753
7209db94ad12
(svn r12236) [NoAI] -Change: [API CHANGE] All valuators are now in the notation: AI<type>List_v<Valuator>. Example: AIVehicleList_vAge
truebrain
parents:
9749
diff
changeset
|
700 |
list.Valuate(AITileList_vDistanceSquareToTile(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
|
701 |
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
|
702 |
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
|
703 |
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
|
704 |
} |
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
|
705 |
|
9753
7209db94ad12
(svn r12236) [NoAI] -Change: [API CHANGE] All valuators are now in the notation: AI<type>List_v<Valuator>. Example: AIVehicleList_vAge
truebrain
parents:
9749
diff
changeset
|
706 |
list.Valuate(AITileList_vCargoAcceptance(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
|
707 |
list.KeepAboveValue(10); |
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9605
diff
changeset
|
708 |
print(" CargoAcceptance(): done"); |
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9605
diff
changeset
|
709 |
print(" KeepAboveValue(10): done"); |
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9605
diff
changeset
|
710 |
print(" Count(): " + list.Count()); |
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9605
diff
changeset
|
711 |
print(" ListDump:"); |
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9605
diff
changeset
|
712 |
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
|
713 |
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
|
714 |
} |
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9605
diff
changeset
|
715 |
|
9753
7209db94ad12
(svn r12236) [NoAI] -Change: [API CHANGE] All valuators are now in the notation: AI<type>List_v<Valuator>. Example: AIVehicleList_vAge
truebrain
parents:
9749
diff
changeset
|
716 |
list.Valuate(AITileList_vRoadTile()); |
9605
2c2348827b52
(svn r9749) [NoAI] -Add: added regression-test for new AITileList valuators
truelight
parents:
9592
diff
changeset
|
717 |
list.KeepValue(1); |
2c2348827b52
(svn r9749) [NoAI] -Add: added regression-test for new AITileList valuators
truelight
parents:
9592
diff
changeset
|
718 |
print(" RoadTile(): done"); |
9609
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9605
diff
changeset
|
719 |
print(" KeepValue(1): done"); |
9605
2c2348827b52
(svn r9749) [NoAI] -Add: added regression-test for new AITileList valuators
truelight
parents:
9592
diff
changeset
|
720 |
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
|
721 |
print(" ListDump:"); |
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9605
diff
changeset
|
722 |
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
|
723 |
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
|
724 |
} |
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9605
diff
changeset
|
725 |
|
9753
7209db94ad12
(svn r12236) [NoAI] -Change: [API CHANGE] All valuators are now in the notation: AI<type>List_v<Valuator>. Example: AIVehicleList_vAge
truebrain
parents:
9749
diff
changeset
|
726 |
list.Valuate(AITileList_vNeighbourRoadCount()); |
9605
2c2348827b52
(svn r9749) [NoAI] -Add: added regression-test for new AITileList valuators
truelight
parents:
9592
diff
changeset
|
727 |
list.KeepValue(1); |
9617
df9cedf12aab
(svn r9786) [NoAI] -Fix: NeighbourRoad -> NeighbourRoadCount
truelight
parents:
9616
diff
changeset
|
728 |
print(" NeighbourRoadCount():done"); |
9609
f0dbf5850145
(svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents:
9605
diff
changeset
|
729 |
print(" KeepValue(1): done"); |
9592
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
9589
diff
changeset
|
730 |
print(" Count(): " + list.Count()); |
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
9589
diff
changeset
|
731 |
print(" ListDump:"); |
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
9589
diff
changeset
|
732 |
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
|
733 |
print(" " + i + " => " + list.GetValue(i)); |
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
9589
diff
changeset
|
734 |
} |
9698
1d50fe99b7e9
(svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents:
9696
diff
changeset
|
735 |
|
1d50fe99b7e9
(svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents:
9696
diff
changeset
|
736 |
list.AddRectangle(54421 - 256 * 2, 256 * 2 + 54421 + 8); |
9753
7209db94ad12
(svn r12236) [NoAI] -Change: [API CHANGE] All valuators are now in the notation: AI<type>List_v<Valuator>. Example: AIVehicleList_vAge
truebrain
parents:
9749
diff
changeset
|
737 |
list.Valuate(AITileList_vWater()); |
9698
1d50fe99b7e9
(svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents:
9696
diff
changeset
|
738 |
print(" Water(): done"); |
1d50fe99b7e9
(svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents:
9696
diff
changeset
|
739 |
print(" Count(): " + list.Count()); |
1d50fe99b7e9
(svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents:
9696
diff
changeset
|
740 |
print(" ListDump:"); |
1d50fe99b7e9
(svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents:
9696
diff
changeset
|
741 |
for (local i = list.Begin(); list.HasNext(); i = list.Next()) { |
1d50fe99b7e9
(svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents:
9696
diff
changeset
|
742 |
print(" " + i + " => " + list.GetValue(i)); |
1d50fe99b7e9
(svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents:
9696
diff
changeset
|
743 |
} |
9592
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
9589
diff
changeset
|
744 |
} |
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
9589
diff
changeset
|
745 |
|
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
|
746 |
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
|
747 |
{ |
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
|
748 |
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
|
749 |
|
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
|
750 |
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
|
751 |
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
|
752 |
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
|
753 |
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
|
754 |
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
|
755 |
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
|
756 |
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
|
757 |
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
|
758 |
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
|
759 |
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
|
760 |
print(" GetLocation(): " + AITown.GetLocation(i)); |
9460
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
761 |
} |
9511 | 762 |
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
|
763 |
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
|
764 |
} |
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
|
765 |
|
9589
2fbda08db406
(svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
9585
diff
changeset
|
766 |
function Regression::TownList() |
2fbda08db406
(svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
9585
diff
changeset
|
767 |
{ |
2fbda08db406
(svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
9585
diff
changeset
|
768 |
local list = AITownList(); |
2fbda08db406
(svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
9585
diff
changeset
|
769 |
|
2fbda08db406
(svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
9585
diff
changeset
|
770 |
print(""); |
2fbda08db406
(svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
9585
diff
changeset
|
771 |
print("--TownList--"); |
2fbda08db406
(svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
9585
diff
changeset
|
772 |
print(" Count(): " + list.Count()); |
9753
7209db94ad12
(svn r12236) [NoAI] -Change: [API CHANGE] All valuators are now in the notation: AI<type>List_v<Valuator>. Example: AIVehicleList_vAge
truebrain
parents:
9749
diff
changeset
|
773 |
list.Valuate(AITownList_vLocation()); |
9649
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
774 |
print(" Location ListDump:"); |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
775 |
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
|
776 |
print(" " + i + " => " + list.GetValue(i)); |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
777 |
} |
9753
7209db94ad12
(svn r12236) [NoAI] -Change: [API CHANGE] All valuators are now in the notation: AI<type>List_v<Valuator>. Example: AIVehicleList_vAge
truebrain
parents:
9749
diff
changeset
|
778 |
list.Valuate(AITownList_vDistanceManhattanToTile(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
|
779 |
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
|
780 |
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
|
781 |
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
|
782 |
} |
9753
7209db94ad12
(svn r12236) [NoAI] -Change: [API CHANGE] All valuators are now in the notation: AI<type>List_v<Valuator>. Example: AIVehicleList_vAge
truebrain
parents:
9749
diff
changeset
|
783 |
list.Valuate(AITownList_vDistanceSquareToTile(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
|
784 |
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
|
785 |
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
|
786 |
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
|
787 |
} |
9753
7209db94ad12
(svn r12236) [NoAI] -Change: [API CHANGE] All valuators are now in the notation: AI<type>List_v<Valuator>. Example: AIVehicleList_vAge
truebrain
parents:
9749
diff
changeset
|
788 |
list.Valuate(AITownList_vPopulation()); |
9589
2fbda08db406
(svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
9585
diff
changeset
|
789 |
list.KeepAboveValue(500); |
2fbda08db406
(svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
9585
diff
changeset
|
790 |
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
|
791 |
print(" Count(): " + list.Count()); |
9649
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
792 |
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
|
793 |
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
|
794 |
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
|
795 |
} |
2fbda08db406
(svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
9585
diff
changeset
|
796 |
} |
2fbda08db406
(svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
9585
diff
changeset
|
797 |
|
9518
b32191854ad9
(svn r9432) [NoAI] -Add: added regression-test for AIVehicle()
truelight
parents:
9511
diff
changeset
|
798 |
function Regression::Vehicle() |
b32191854ad9
(svn r9432) [NoAI] -Add: added regression-test for AIVehicle()
truelight
parents:
9511
diff
changeset
|
799 |
{ |
9557
a3e1a25cf3d3
(svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents:
9555
diff
changeset
|
800 |
local accounting = AIAccounting(); |
9518
b32191854ad9
(svn r9432) [NoAI] -Add: added regression-test for AIVehicle()
truelight
parents:
9511
diff
changeset
|
801 |
|
b32191854ad9
(svn r9432) [NoAI] -Add: added regression-test for AIVehicle()
truelight
parents:
9511
diff
changeset
|
802 |
print(""); |
b32191854ad9
(svn r9432) [NoAI] -Add: added regression-test for AIVehicle()
truelight
parents:
9511
diff
changeset
|
803 |
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
|
804 |
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
|
805 |
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
|
806 |
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
|
807 |
print(" ISValidVehicle(9999): " + AIVehicle.IsValidVehicle(9999)); |
9518
b32191854ad9
(svn r9432) [NoAI] -Add: added regression-test for AIVehicle()
truelight
parents:
9511
diff
changeset
|
808 |
|
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 |
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
|
810 |
|
9560
ff2dde050a4c
(svn r9498) [NoAI] -Add: added regression for AITransactionMode()
truelight
parents:
9558
diff
changeset
|
811 |
{ |
ff2dde050a4c
(svn r9498) [NoAI] -Add: added regression for AITransactionMode()
truelight
parents:
9558
diff
changeset
|
812 |
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
|
813 |
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
|
814 |
print(" IsValidVehicle(11): " + AIVehicle.IsValidVehicle(11)); |
9560
ff2dde050a4c
(svn r9498) [NoAI] -Add: added regression for AITransactionMode()
truelight
parents:
9558
diff
changeset
|
815 |
|
ff2dde050a4c
(svn r9498) [NoAI] -Add: added regression for AITransactionMode()
truelight
parents:
9558
diff
changeset
|
816 |
print(" --Transaction--"); |
ff2dde050a4c
(svn r9498) [NoAI] -Add: added regression for AITransactionMode()
truelight
parents:
9558
diff
changeset
|
817 |
print(" GetCosts(): " + transaction.GetCosts()); |
ff2dde050a4c
(svn r9498) [NoAI] -Add: added regression for AITransactionMode()
truelight
parents:
9558
diff
changeset
|
818 |
print(" Execute(): " + transaction.Execute()); |
ff2dde050a4c
(svn r9498) [NoAI] -Add: added regression for AITransactionMode()
truelight
parents:
9558
diff
changeset
|
819 |
|
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
|
820 |
print(" IsValidVehicle(11): " + AIVehicle.IsValidVehicle(11)); |
9560
ff2dde050a4c
(svn r9498) [NoAI] -Add: added regression for AITransactionMode()
truelight
parents:
9558
diff
changeset
|
821 |
} |
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
|
822 |
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
|
823 |
|
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
|
824 |
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
|
825 |
|
a3e1a25cf3d3
(svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents:
9555
diff
changeset
|
826 |
print(" --Accounting--"); |
a3e1a25cf3d3
(svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents:
9555
diff
changeset
|
827 |
print(" GetCosts(): " + accounting.GetCosts()); |
a3e1a25cf3d3
(svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents:
9555
diff
changeset
|
828 |
print(" Should be: " + (bank - bank_after)); |
a3e1a25cf3d3
(svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents:
9555
diff
changeset
|
829 |
print(" ResetCosts(): " + accounting.ResetCosts()); |
a3e1a25cf3d3
(svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents:
9555
diff
changeset
|
830 |
|
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
|
831 |
bank = AICompany.GetBankBalance(AICompany.MY_COMPANY); |
9557
a3e1a25cf3d3
(svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents:
9555
diff
changeset
|
832 |
|
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
|
833 |
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
|
834 |
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
|
835 |
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
|
836 |
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
|
837 |
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
|
838 |
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
|
839 |
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
|
840 |
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
|
841 |
print(" IsStoppedInDepot(): " + AIVehicle.IsStoppedInDepot(11)); |
9557
a3e1a25cf3d3
(svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents:
9555
diff
changeset
|
842 |
|
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 |
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
|
844 |
|
a3e1a25cf3d3
(svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents:
9555
diff
changeset
|
845 |
print(" --Accounting--"); |
a3e1a25cf3d3
(svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents:
9555
diff
changeset
|
846 |
print(" GetCosts(): " + accounting.GetCosts()); |
a3e1a25cf3d3
(svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents:
9555
diff
changeset
|
847 |
print(" Should be: " + (bank - bank_after)); |
a3e1a25cf3d3
(svn r9495) [NoAI] -Add: add regression for AIAccounting() in AIVehicle() regression
truelight
parents:
9555
diff
changeset
|
848 |
|
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
|
849 |
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
|
850 |
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
|
851 |
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
|
852 |
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
|
853 |
|
9615
f809cdc8e360
(svn r9782) [NoAI] -Add: add information functions to AIVehicle, like the valuators of AIVehicleList
truelight
parents:
9614
diff
changeset
|
854 |
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
|
855 |
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
|
856 |
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
|
857 |
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
|
858 |
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
|
859 |
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
|
860 |
print(" GetAgeLeft(): " + AIVehicle.GetAgeLeft(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
|
861 |
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
|
862 |
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
|
863 |
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
|
864 |
print(" GetVehicleType(): " + AIVehicle.GetVehicleType(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
|
865 |
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
|
866 |
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
|
867 |
|
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
|
868 |
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
|
869 |
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
|
870 |
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
|
871 |
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
|
872 |
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
|
873 |
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
|
874 |
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
|
875 |
|
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
|
876 |
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
|
877 |
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
|
878 |
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
|
879 |
print(" IsStoppedInDepot(15): " + AIVehicle.IsStoppedInDepot(15)); |
9654
b836eb5c521f
(svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
9652
diff
changeset
|
880 |
|
9614
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
881 |
local list = AIVehicleList(); |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
882 |
|
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
883 |
print(""); |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
884 |
print("--VehicleList--"); |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
885 |
print(" Count(): " + list.Count()); |
9753
7209db94ad12
(svn r12236) [NoAI] -Change: [API CHANGE] All valuators are now in the notation: AI<type>List_v<Valuator>. Example: AIVehicleList_vAge
truebrain
parents:
9749
diff
changeset
|
886 |
list.Valuate(AIVehicleList_vLocation()); |
9614
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
887 |
print(" Location ListDump:"); |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
888 |
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
|
889 |
print(" " + i + " => " + list.GetValue(i)); |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
890 |
} |
9753
7209db94ad12
(svn r12236) [NoAI] -Change: [API CHANGE] All valuators are now in the notation: AI<type>List_v<Valuator>. Example: AIVehicleList_vAge
truebrain
parents:
9749
diff
changeset
|
891 |
list.Valuate(AIVehicleList_vEngineType()); |
9614
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
892 |
print(" EngineType ListDump:"); |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
893 |
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
|
894 |
print(" " + i + " => " + list.GetValue(i)); |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
895 |
} |
9753
7209db94ad12
(svn r12236) [NoAI] -Change: [API CHANGE] All valuators are now in the notation: AI<type>List_v<Valuator>. Example: AIVehicleList_vAge
truebrain
parents:
9749
diff
changeset
|
896 |
list.Valuate(AIVehicleList_vUnitNumber()); |
9614
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
897 |
print(" UnitNumber ListDump:"); |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
898 |
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
|
899 |
print(" " + i + " => " + list.GetValue(i)); |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
900 |
} |
9753
7209db94ad12
(svn r12236) [NoAI] -Change: [API CHANGE] All valuators are now in the notation: AI<type>List_v<Valuator>. Example: AIVehicleList_vAge
truebrain
parents:
9749
diff
changeset
|
901 |
list.Valuate(AIVehicleList_vAge()); |
9614
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
902 |
print(" Age ListDump:"); |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
903 |
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
|
904 |
print(" " + i + " => " + list.GetValue(i)); |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
905 |
} |
9753
7209db94ad12
(svn r12236) [NoAI] -Change: [API CHANGE] All valuators are now in the notation: AI<type>List_v<Valuator>. Example: AIVehicleList_vAge
truebrain
parents:
9749
diff
changeset
|
906 |
list.Valuate(AIVehicleList_vMaxAge()); |
9614
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
907 |
print(" MaxAge ListDump:"); |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
908 |
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
|
909 |
print(" " + i + " => " + list.GetValue(i)); |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
910 |
} |
9753
7209db94ad12
(svn r12236) [NoAI] -Change: [API CHANGE] All valuators are now in the notation: AI<type>List_v<Valuator>. Example: AIVehicleList_vAge
truebrain
parents:
9749
diff
changeset
|
911 |
list.Valuate(AIVehicleList_vAgeLeft()); |
9614
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
912 |
print(" AgeLeft ListDump:"); |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
913 |
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
|
914 |
print(" " + i + " => " + list.GetValue(i)); |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
915 |
} |
9753
7209db94ad12
(svn r12236) [NoAI] -Change: [API CHANGE] All valuators are now in the notation: AI<type>List_v<Valuator>. Example: AIVehicleList_vAge
truebrain
parents:
9749
diff
changeset
|
916 |
list.Valuate(AIVehicleList_vProfitThisYear()); |
9614
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
917 |
print(" ProfitThisYear ListDump:"); |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
918 |
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
|
919 |
print(" " + i + " => " + list.GetValue(i)); |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
920 |
} |
9753
7209db94ad12
(svn r12236) [NoAI] -Change: [API CHANGE] All valuators are now in the notation: AI<type>List_v<Valuator>. Example: AIVehicleList_vAge
truebrain
parents:
9749
diff
changeset
|
921 |
list.Valuate(AIVehicleList_vProfitLastYear()); |
9614
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
922 |
print(" ProfitLastYear ListDump:"); |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
923 |
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
|
924 |
print(" " + i + " => " + list.GetValue(i)); |
814c3bbf8ecc
(svn r9781) [NoAI] -Add: added AIVehicleListProfit[This|Last]Year as valuator
truelight
parents:
9611
diff
changeset
|
925 |
} |
9753
7209db94ad12
(svn r12236) [NoAI] -Change: [API CHANGE] All valuators are now in the notation: AI<type>List_v<Valuator>. Example: AIVehicleList_vAge
truebrain
parents:
9749
diff
changeset
|
926 |
list.Valuate(AIVehicleList_vVehicleType()); |
9684
623970482fb2
(svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents:
9682
diff
changeset
|
927 |
print(" VehicleType ListDump:"); |
623970482fb2
(svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents:
9682
diff
changeset
|
928 |
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
|
929 |
print(" " + i + " => " + list.GetValue(i)); |
623970482fb2
(svn r10633) [NoAI] -Add: added GetVehicleType and AIVehicle::VehicleType
truelight
parents:
9682
diff
changeset
|
930 |
} |
9518
b32191854ad9
(svn r9432) [NoAI] -Add: added regression-test for AIVehicle()
truelight
parents:
9511
diff
changeset
|
931 |
} |
b32191854ad9
(svn r9432) [NoAI] -Add: added regression-test for AIVehicle()
truelight
parents:
9511
diff
changeset
|
932 |
|
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
|
933 |
|
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
|
934 |
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
|
935 |
{ |
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
|
936 |
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
|
937 |
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
|
938 |
this.Base(); |
9691
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
9684
diff
changeset
|
939 |
this.List(); |
9654
b836eb5c521f
(svn r10556) [NoAI] -Add: added AIAirport, which can build an airport
truelight
parents:
9652
diff
changeset
|
940 |
this.Airport(); |
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
|
941 |
this.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
|
942 |
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
|
943 |
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
|
944 |
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
|
945 |
this.Event(); |
9460
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
946 |
this.Industry(); |
9649
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9648
diff
changeset
|
947 |
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
|
948 |
this.Map(); |
9691
1231d4e5f5aa
(svn r10679) [NoAI] -Add: added AIMarine, which takes care of Ships, Docks, ...
truelight
parents:
9684
diff
changeset
|
949 |
this.Marine(); |
9652
c15bf5355b95
(svn r10553) [NoAI] -Add: added a framework for AIPathFinder() and implemented a really stupid AIPathFinderStupid()
truelight
parents:
9649
diff
changeset
|
950 |
this.PathFinder(); |
9485
df09b849ca60
(svn r9335) [NoAI] -Update: added AIRoad() regression test
truelight
parents:
9470
diff
changeset
|
951 |
this.Road(); |
9511 | 952 |
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
|
953 |
this.Station(); |
9592
c5c09cfde63a
(svn r9625) [NoAI] -Add: added AITileList() and one valuator for now: AITileListBuildable()
truelight
parents:
9589
diff
changeset
|
954 |
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
|
955 |
this.Town(); |
9589
2fbda08db406
(svn r9622) [NoAI] -Add: added AITownList, which lists all towns (and which you can iterate)
truelight
parents:
9585
diff
changeset
|
956 |
this.TownList(); |
9518
b32191854ad9
(svn r9432) [NoAI] -Add: added regression-test for AIVehicle()
truelight
parents:
9511
diff
changeset
|
957 |
this.Vehicle(); |
9546
fde20f518285
(svn r9477) [NoAI] -Add: added regression-test for AIOrder()
truelight
parents:
9541
diff
changeset
|
958 |
/* Order has to be after Vehicle */ |
fde20f518285
(svn r9477) [NoAI] -Add: added regression-test for AIOrder()
truelight
parents:
9541
diff
changeset
|
959 |
this.Order(); |
9460
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
960 |
} |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
961 |
|
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
|
962 |
function Regression::Stop() |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
963 |
{ |
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
|
964 |
this.stop = true; |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
965 |
} |
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
|
966 |
|
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
|
967 |
class FRegression extends AIFactory { |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
968 |
function GetAuthor() { return "OpenTTD Dev Team"; } |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
969 |
function GetName() { return "Regression"; } |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
970 |
function GetDescription() { return "This runs regression-tests on all commands. On the same map the result should always be the same."; } |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
971 |
function GetVersion() { return 1; } |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
972 |
function GetDate() { return "2007-03-18"; } |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
973 |
function CreateInstance() { return "Regression"; } |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
974 |
} |
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
|
975 |
|
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
|
976 |
/* Only enable this if you want to run the regression test. |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
977 |
* The best way to do it is to disable all other AIs, so you are sure thisone |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
978 |
* kicks in, and use a pre-made savegame of which you already know the result. |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
979 |
* You can compare the output from this AI with the pre-made one, and it should |
b10064d51d98
(svn r9291) [NoAI] -Add: added the first version of a regression AI, an AI that tests all API functions for consistancy.
truelight
parents:
diff
changeset
|
980 |
* match. If not, something went wrong. */ |
9470
4593c953a276
(svn r9308) [NoAI] -Change: make the regression scripts run without any user intervention; not manual enabling and disabling of AIs
rubidium
parents:
9461
diff
changeset
|
981 |
iFRegression <-FRegression(); |