# HG changeset patch # User truelight # Date 1174314306 0 # Node ID df09b849ca608ac1dbc9fb60406f91d6308a21c1 # Parent a52f67952f04a120053bdcff05ec74dd42e82b92 (svn r9335) [NoAI] -Update: added AIRoad() regression test diff -r a52f67952f04 -r df09b849ca60 bin/ai/regression/regression.nut --- a/bin/ai/regression/regression.nut Mon Mar 19 14:24:43 2007 +0000 +++ b/bin/ai/regression/regression.nut Mon Mar 19 14:25:06 2007 +0000 @@ -126,6 +126,63 @@ print(" IsValidTile(): " + map.IsValidTile(map.GetMapSize() - 1)); } +function Regression::Road() +{ + local company = AICompany(); + local road = AIRoad(); + + print(""); + print("--Road--"); + print(" Road"); + print(" GetBankBalance(): " + company.GetBankBalance()); + print(" IsRoadTile(): " + road.IsRoadTile(33411)); + print(" BuildRoad(): " + road.BuildRoad(0, 1)); + print(" BuildRoad(): " + road.BuildRoad(33411, 33411)); + print(" BuildRoad(): " + road.BuildRoad(33411, 33414)); + print(" IsRoadTile(): " + road.IsRoadTile(33411)); + print(" GetBankBalance(): " + company.GetBankBalance()); + print(" RemoveRoad(): " + road.RemoveRoad(33411, 33411)); + print(" RemoveRoad(): " + road.RemoveRoad(33411, 33412)); + print(" RemoveRoad(): " + road.RemoveRoad(19590, 19590)); + print(" GetBankBalance(): " + company.GetBankBalance()); + + print(" Depot"); + print(" GetBankBalance(): " + company.GetBankBalance()); + print(" IsRoadTile(): " + road.IsRoadTile(33411)); + print(" BuildRoadDepot(): " + road.BuildRoadDepot(0, 1)); + print(" BuildRoadDepot(): " + road.BuildRoadDepot(33411, 33411)); + print(" BuildRoadDepot(): " + road.BuildRoadDepot(33411, 33414)); + print(" BuildRoadDepot(): " + road.BuildRoadDepot(33411, 33412)); + print(" IsRoadTile(): " + road.IsRoadTile(33411)); + print(" GetBankBalance(): " + company.GetBankBalance()); + print(" RemoveRoadDepot(): " + road.RemoveRoadDepot(33411)); + print(" RemoveRoadDepot(): " + road.RemoveRoadDepot(33411)); + print(" GetBankBalance(): " + company.GetBankBalance()); + + print(" Station"); + print(" GetBankBalance(): " + company.GetBankBalance()); + print(" IsRoadTile(): " + road.IsRoadTile(33411)); + print(" BuildRoadStation(): " + road.BuildRoadStation(0, 1)); + print(" BuildRoadStation(): " + road.BuildRoadStation(33411, 33411, false, false)); + print(" BuildRoadStation(): " + road.BuildRoadStation(33411, 33414, false, false)); + print(" BuildRoadStation(): " + road.BuildRoadStation(33411, 33412, false, false)); + print(" IsRoadTile(): " + road.IsRoadTile(33411)); + print(" GetBankBalance(): " + company.GetBankBalance()); + print(" RemoveRoadStation(): " + road.RemoveRoadStation(33411)); + print(" RemoveRoadStation(): " + road.RemoveRoadStation(33411)); + print(" GetBankBalance(): " + company.GetBankBalance()); + + print(" Station Types"); + print(" BuildRoadStation(truck): " + road.BuildRoadStation(33411, 33410, false, false)); + print(" BuildRoadStation(bus): " + road.BuildRoadStation(33412, 33413, true, false)); + print(" BuildRoadStation(truck): " + road.BuildRoadStation(33411 + 256, 33411, false, false)); + print(" BuildRoadStation(bus): " + road.BuildRoadStation(33412 + 256, 33412 + 256 + 256, true, false)); + print(" BuildRoadStation(truck-drive): " + road.BuildRoadStation(33413, 33412, false, true)); + print(" BuildRoadStation(bus-drive): " + road.BuildRoadStation(33414, 33413, true, true)); + print(" BuildRoadStation(truck-drive): " + road.BuildRoadStation(33415, 33414, false, true)); + print(" BuildRoadStation(bus-drive): " + road.BuildRoadStation(33416, 33415, true, true)); +} + function Regression::Town() { local town = AITown(); @@ -156,6 +213,7 @@ this.Company(); this.Industry(); this.Map(); + this.Road(); this.Town(); } diff -r a52f67952f04 -r df09b849ca60 bin/ai/regression/regression.txt --- a/bin/ai/regression/regression.txt Mon Mar 19 14:24:43 2007 +0000 +++ b/bin/ai/regression/regression.txt Mon Mar 19 14:25:06 2007 +0000 @@ -464,6 +464,53 @@ IsValidTile(): false IsValidTile(): true +--Road-- + Road + GetBankBalance(): 300000 + IsRoadTile(): false + BuildRoad(): false + BuildRoad(): false + BuildRoad(): true + IsRoadTile(): true + GetBankBalance(): 299398 + RemoveRoad(): true + RemoveRoad(): true + RemoveRoad(): true + GetBankBalance(): 299278 + Depot + GetBankBalance(): 299278 + IsRoadTile(): false + BuildRoadDepot(): false + BuildRoadDepot(): false + BuildRoadDepot(): true + BuildRoadDepot(): false + IsRoadTile(): false + GetBankBalance(): 298903 + RemoveRoadDepot(): true + RemoveRoadDepot(): false + GetBankBalance(): 298843 + Station + GetBankBalance(): 298843 + IsRoadTile(): false + BuildRoadStation(): false + BuildRoadStation(): false + BuildRoadStation(): true + BuildRoadStation(): false + IsRoadTile(): false + GetBankBalance(): 298693 + RemoveRoadStation(): true + RemoveRoadStation(): false + GetBankBalance(): 298656 + Station Types + BuildRoadStation(truck): true + BuildRoadStation(bus): true + BuildRoadStation(truck): true + BuildRoadStation(bus): true + BuildRoadStation(truck-drive): true + BuildRoadStation(bus-drive): true + BuildRoadStation(truck-drive): true + BuildRoadStation(bus-drive): true + --Town-- GetMaxTownID(): 31 GetTownCount(): 28