示例#1
0
文件: GrabSell.java 项目: erikh/swath
  public boolean runScript() throws Exception {
    int fuel = 0;
    int org = 0;
    int equip = 0;
    int holds = Swath.ship.holds();

    // Set product amounts
    switch (m_type.getCurrentChoice()) {
      case Swath.FUEL_ORE:
        fuel = holds;
        break;
      case Swath.ORGANICS:
        org = holds;
        break;
      case Swath.EQUIPMENT:
        equip = holds;
        break;
    }

    // Loop
    while (true) {
      Land.exec(m_planet.getInteger());
      TakeLeaveProducts.exec(fuel, org, equip);
      LiftOff.exec();
      Trade.exec(-fuel, -org, -equip);
    }
  }