public org.bwapi.proxy.messages.GameMessages.UpgradeType getUpgrades(int index) {
        if (upgradesBuilder_ == null) {
          return upgrades_.get(index);
        } else {
          return upgradesBuilder_.getMessage(index);
        }
      }