use of delta.games.lotro.lore.items.ItemsManager 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;
}
use of delta.games.lotro.lore.items.ItemsManager in project lotro-companion by dmorcellet.
the class MainTestItemEditionWindowController method main.
/**
* Basic main method for test.
* @param args Not used.
*/
public static void main(String[] args) {
ItemsManager itemsMgr = ItemsManager.getInstance();
List<Item> items = itemsMgr.getAllItems();
int nbWindows = 0;
int index = 0;
int nbItems = items.size();
while ((index < nbItems) && (nbWindows < 1)) {
// Item item=itemsMgr.getItem(1879313783); // Light Nadhin Hood (level 192)
// Item item=itemsMgr.getItem(1879323547); // Bridge-warden's Shield (level 201)
// Item item=itemsMgr.getItem(1879134849); // Javelin of Ire
// Item item=itemsMgr.getItem(1879311750); // Reshaped Minstrel's Club of the First Age
// Lesser Valourous Helm of Fate
Item item = itemsMgr.getItem(1879279194);
// Item item=items.get(index);
// if ((item.getQuality()==ItemQuality.LEGENDARY) && (Integer.valueOf(192).equals(item.getItemLevel())))
// if (item instanceof Armour)
// if (item instanceof Weapon)
{
ItemEditionWindowController ctrl = new ItemEditionWindowController(null, item);
ctrl.show(true);
nbWindows++;
}
index++;
}
}
use of delta.games.lotro.lore.items.ItemsManager in project lotro-tools by dmorcellet.
the class ItemsResolver method loadFileIds.
/**
* Load map (keys/names)->list of item ids
* @return a map.
*/
private HashMap<String, List<Item>> loadFileIds() {
HashMap<String, List<Item>> idStr2Id = new HashMap<String, List<Item>>();
ItemsManager mgr = ItemsManager.getInstance();
List<Item> items = mgr.getAllItems();
for (Item item : items) {
String key = item.getKey();
registerMapping(idStr2Id, key, item);
String name = item.getName();
registerMapping(idStr2Id, name, item);
String legacyName = item.getProperty(ItemPropertyNames.LEGACY_NAME);
registerMapping(idStr2Id, legacyName, item);
String oldTulkasName = item.getProperty(ItemPropertyNames.OLD_TULKAS_NAME);
registerMapping(idStr2Id, oldTulkasName, item);
String iconUrl = item.getProperty(ItemPropertyNames.ICON_URL);
iconUrl = normalizeIconUrl(iconUrl);
registerMapping(idStr2Id, iconUrl, item);
}
/*
List<String> keys=new ArrayList<String>(idStr2Id.keySet());
Collections.sort(keys);
for(String key : keys)
{
List<Item> itemsForId=idStr2Id.get(key);
//if (ids.size()>1)
{
System.out.println("*************** "+key+" ******************");
Collections.sort(items,new ItemIdComparator());
for(Item item : itemsForId)
{
System.out.println("\t"+item);
}
}
}
*/
return idStr2Id;
}
Aggregations