Пример #1
0
 public static Item getItem(final int typeID) {
   Item item = StaticData.get().getItems().get(typeID);
   if (item != null) {
     return item;
   } else {
     return new Item(typeID);
   }
 }
Пример #2
0
 public static String flag(final int flag, final MyAsset parentAsset) {
   ItemFlag itemFlag = StaticData.get().getItemFlags().get(flag);
   if (itemFlag != null) {
     if (parentAsset != null && !parentAsset.getFlag().isEmpty()) {
       return parentAsset.getFlag() + " > " + itemFlag.getFlagName();
     } else {
       return itemFlag.getFlagName();
     }
   }
   return "!" + flag;
 }
Пример #3
0
 StockpileItem showEdit(final StockpileItem addStockpileItem) {
   updateData();
   this.stockpileItem = addStockpileItem;
   this.getDialog().setTitle(TabsStockpile.get().editStockpileItem());
   Item item = StaticData.get().getItems().get(addStockpileItem.getTypeID());
   jItems.setSelectedItem(item);
   jCopy.setSelected(addStockpileItem.isBPC());
   jCountMinimum.setText(String.valueOf(addStockpileItem.getCountMinimum()));
   show();
   return stockpileItem;
 }
Пример #4
0
 public static void addLocation(final Station station) {
   MyLocation system = getLocation(station.getSolarSystemID());
   MyLocation location =
       new MyLocation(
           station.getStationID(),
           station.getStationName(),
           system.getSystemID(),
           system.getSystem(),
           system.getRegionID(),
           system.getRegion(),
           system.getSecurity());
   StaticData.get().getLocations().put(location.getLocationID(), location);
 }
Пример #5
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;
 }
Пример #6
0
 private void updateData() {
   stockpile = null;
   stockpileItem = null;
   List<Item> itemsList = new ArrayList<Item>(StaticData.get().getItems().values());
   Collections.sort(itemsList);
   try {
     items.getReadWriteLock().writeLock().lock();
     items.clear();
     items.addAll(itemsList);
   } finally {
     items.getReadWriteLock().writeLock().unlock();
   }
   jItems.setSelectedIndex(0);
   jCountMinimum.setText("");
   jItems.setEnabled(true);
 }
Пример #7
0
 public static MyLocation getLocation(long locationID, final MyAsset parentAsset) {
   // Offices
   if (locationID >= 66000000) {
     if (locationID < 66014933) {
       locationID = locationID - 6000001;
     } else {
       locationID = locationID - 6000000;
     }
   }
   MyLocation location = StaticData.get().getLocations().get(locationID);
   if (location != null) {
     return location;
   }
   if (parentAsset != null) {
     location = parentAsset.getLocation();
     if (location != null) {
       return location;
     }
   }
   return new MyLocation(locationID);
 }