Ejemplo n.º 1
0
 public MyAsset(
     final Item item,
     final MyLocation location,
     final Owner owner,
     final long count,
     final List<MyAsset> parents,
     final String flag,
     final int flagID,
     final long itemID,
     final boolean singleton,
     final int rawQuantity) {
   this.item = item;
   this.location = location;
   this.owner = owner;
   this.count = count;
   this.parents = parents;
   this.flag = flag;
   this.flagID = flagID;
   this.itemID = itemID;
   this.volume = item.getVolume();
   this.singleton = singleton;
   this.rawQuantity = rawQuantity;
   // The order matter!
   // 1st
   // rawQuantity: -1 = BPO. Only BPOs can be packaged (singleton == false). Only packaged items
   // can be stacked (count > 1)
   this.bpo = (item.isBlueprint() && (rawQuantity == -1 || !singleton || count > 1));
   // rawQuantity: -2 = BPC
   this.bpc = (item.isBlueprint() && rawQuantity == -2);
   // 2nd
   if (item.isBlueprint()) {
     if (isBPO()) {
       this.typeName = item.getTypeName() + " (BPO)";
     } else if (isBPC()) {
       this.typeName = item.getTypeName() + " (BPC)";
     } else {
       this.bpc = true;
       this.typeName = item.getTypeName() + " (BP)";
     }
   } else {
     this.typeName = item.getTypeName();
   }
   // 3rd
   this.name = getTypeName();
 }
Ejemplo n.º 2
0
  public double getPriceSellMin() {
    if (item.isBlueprint() && !isBPO()) {
      return 0;
    }

    if (this.getPriceData() != null) {
      return this.getPriceData().getSellMin();
    }

    return 0;
  }
Ejemplo n.º 3
0
  private static double getPriceType(
      final int typeID, final boolean isBlueprintCopy, boolean reprocessed) {
    UserItem<Integer, Double> userPrice;
    if (isBlueprintCopy) { // Blueprint Copy
      userPrice = Settings.get().getUserPrices().get(-typeID);
    } else { // All other
      userPrice = Settings.get().getUserPrices().get(typeID);
    }
    if (userPrice != null) {
      return userPrice.getValue();
    }

    // Blueprint Copy (Default Zero)
    if (isBlueprintCopy) {
      return 0;
    }

    // Blueprints Base Price
    Item item = getItem(typeID);
    // Tech 1
    if (item.isBlueprint()) {
      if (Settings.get().isBlueprintBasePriceTech1()
          && !item.getTypeName().toLowerCase().contains("ii")) {
        return item.getPriceBase();
      }
      // Tech 2
      if (Settings.get().isBlueprintBasePriceTech2()
          && item.getTypeName().toLowerCase().contains("ii")) {
        return item.getPriceBase();
      }
    }

    // Price data
    PriceData priceData = Settings.get().getPriceData().get(typeID);
    if (priceData != null && priceData.isEmpty()) {
      priceData = null;
    }
    if (reprocessed) {
      return Settings.get().getPriceDataSettings().getDefaultPriceReprocessed(priceData);
    } else {
      return Settings.get().getPriceDataSettings().getDefaultPrice(priceData);
    }
  }