class MoneyTest { function DoMoneyTest() { /* Build the airports for real */ local last_cost = AIAccounting(); if (AITestMode() && DoBuildAirport()) { if (WrightAI.HasMoney(last_cost.GetCosts())) WrightAI.GetMoney(last_cost.GetCosts()); } if (!DoBuildAirport()) { WrightAI.RepayLoan(); // AILog.Warning("Although the testing told us we could build 2 airports, it still failed on the first airport at tile " + airport1_location + "."); assert(AIError.GetLastError() != AIError.ERR_STATION_TOO_SPREAD_OUT); return false; } WrightAI.RepayLoan(); return true; } } class TestBuildAirport extends MoneyTest { loc = null; tp = null; id = null; constructor(location, type, theid) { loc = location; tp = type; id = theid; } function DoBuildAirport() { return AIAirport.BuildAirport(loc, tp, id); } }