Loading

Paste #pgunmzidm

  1. class MoneyTest {
  2.     function DoMoneyTest() {
  3.         /* Build the airports for real */
  4.         local last_cost = AIAccounting();
  5.         if (AITestMode() && DoBuildAirport()) {
  6.             if (WrightAI.HasMoney(last_cost.GetCosts())) WrightAI.GetMoney(last_cost.GetCosts());
  7.         }
  8.         if (!DoBuildAirport()) {
  9.             WrightAI.RepayLoan();
  10. //          AILog.Warning("Although the testing told us we could build 2 airports, it still failed on the first airport at tile " + airport1_location + ".");
  11.             assert(AIError.GetLastError() != AIError.ERR_STATION_TOO_SPREAD_OUT);
  12.             return false;
  13.         }
  14.         WrightAI.RepayLoan();
  15.         return true;
  16.     }
  17. }
  18.  
  19. class TestBuildAirport extends MoneyTest {
  20.     loc = null;
  21.     tp = null;
  22.     id = null;
  23.     constructor(location, type, theid) {
  24.         loc = location;
  25.         tp = type;
  26.         id = theid;
  27.     }
  28.  
  29.     function DoBuildAirport() {
  30.         return AIAirport.BuildAirport(loc, tp, id);
  31.     }
  32. }

Comments