示例#1
0
 public static float getVolume(final int typeID, final boolean packaged) {
   Item item = StaticData.get().getItems().get(typeID);
   if (item != null) {
     if (packagedVolume.isEmpty()) {
       buildVolume();
     }
     if (packaged && packagedVolume.containsKey(item.getGroup())) {
       return packagedVolume.get(item.getGroup());
     } else {
       return item.getVolume();
     }
   }
   return 0;
 }
示例#2
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();
 }