use of delta.games.lotro.character.storage.StoredItem in project lotro-companion by dmorcellet.
the class MainTestShowCharacterStorage method getAllItems.
private List<StoredItem> getAllItems(Vault container) {
List<StoredItem> items = new ArrayList<StoredItem>();
int chests = container.getChestCount();
// int itemsCount=0;
for (int i = 0; i < chests; i++) {
Chest chest = container.getChest(i);
if (chest != null) {
List<StoredItem> chestItems = chest.getAllItemsByName();
// itemsCount+=chestItems.size();
items.addAll(chestItems);
}
}
// System.out.println(itemsCount);
return items;
}
use of delta.games.lotro.character.storage.StoredItem in project lotro-companion by dmorcellet.
the class MainTestShowCharacterStorage method show.
private void show(List<StoredItem> storedItems) {
List<Item> items = getItems(storedItems);
ItemFilterController filterController = new ItemFilterController();
Filter<Item> filter = filterController.getFilter();
ItemChoiceWindowController choiceCtrl = new ItemChoiceWindowController(null, null, items, filter, filterController);
choiceCtrl.show();
}
use of delta.games.lotro.character.storage.StoredItem in project lotro-companion by dmorcellet.
the class MainTestShowCharacterStorage method getItems.
private List<Item> getItems(List<StoredItem> storedItems) {
ItemsManager itemsMgr = ItemsManager.getInstance();
List<Item> allItems = itemsMgr.getAllItems();
List<Item> selection = new ArrayList<Item>();
for (StoredItem storedItem : storedItems) {
Item selectedItem = null;
for (Item item : allItems) {
Item match = match(item, storedItem);
if (match != null) {
selectedItem = item;
break;
}
}
if (selectedItem != null) {
selection.add(selectedItem);
} else {
LOGGER.warn("Could not find item: " + storedItem.getName());
}
}
return selection;
}
Aggregations