use of delta.games.lotro.lore.items.io.xml.ItemXMLParser in project lotro-tools by dmorcellet.
the class ItemsConcat method main.
/**
* Main method.
* @param args Not used.
*/
public static void main(String[] args) {
System.out.println("Concatenation of legacy items into one file...");
File itemsDir = new File("d:\\dam\\tmp\\items");
FileFilter fileFilter = new ExtensionPredicate("xml");
File[] itemFiles = itemsDir.listFiles(fileFilter);
if (itemFiles != null) {
// BonusConverter converter=new BonusConverter();
ItemXMLParser parser = new ItemXMLParser();
List<Item> itemsList = new ArrayList<Item>();
for (File itemFile : itemFiles) {
String idStr = itemFile.getName();
idStr = idStr.substring(0, idStr.length() - 4);
int id = NumericTools.parseInt(idStr, -1);
if (id != -1) {
// System.out.println(id);
Item item = parser.parseXML(itemFile);
/*
List<String> bonuses=item.getBonus();
if (bonuses.size()>0)
{
RawBonusParser bonusParser=new RawBonusParser();
BonusManager bonusMgr=bonusParser.build(bonuses);
if (bonusParser.hasWarn())
{
String name=item.getName();
System.out.println("Item: "+id+", name="+name);
for(String bonus : bonuses)
{
System.out.println("\t"+bonus);
}
}
if (bonusMgr!=null)
{
BasicStatsSet stats=converter.getStats(bonusMgr);
item.getStats().setStats(stats);
}
}
*/
item.setIdentifier(id);
itemsList.add(item);
}
}
File toFile = new File("itemsLegacy.xml").getAbsoluteFile();
ItemXMLWriter.writeItemsFile(toFile, itemsList);
}
}
use of delta.games.lotro.lore.items.io.xml.ItemXMLParser in project lotro-tools by dmorcellet.
the class IconsDbBuilder method loadItemsFile.
private HashMap<Integer, Item> loadItemsFile(File file) {
ItemXMLParser parser = new ItemXMLParser();
List<Item> items = parser.parseItemsFile(file);
HashMap<Integer, Item> ret = new HashMap<Integer, Item>();
for (Item item : items) {
ret.put(Integer.valueOf(item.getIdentifier()), item);
}
return ret;
}
use of delta.games.lotro.lore.items.io.xml.ItemXMLParser in project lotro-tools by dmorcellet.
the class ItemIconsDownloader method loadItemsFile.
private HashMap<Integer, Item> loadItemsFile(File file) {
ItemXMLParser parser = new ItemXMLParser();
List<Item> items = parser.parseItemsFile(file);
HashMap<Integer, Item> ret = new HashMap<Integer, Item>();
for (Item item : items) {
ret.put(Integer.valueOf(item.getIdentifier()), item);
}
return ret;
}
use of delta.games.lotro.lore.items.io.xml.ItemXMLParser in project lotro-tools by dmorcellet.
the class LegacyIconsExtractor method loadItemsFile.
private HashMap<Integer, Item> loadItemsFile(File file) {
ItemXMLParser parser = new ItemXMLParser();
List<Item> items = parser.parseItemsFile(file);
HashMap<Integer, Item> ret = new HashMap<Integer, Item>();
for (Item item : items) {
ret.put(Integer.valueOf(item.getIdentifier()), item);
}
return ret;
}
Aggregations