use of delta.games.lotro.lore.deeds.io.xml.DeedXMLWriter in project lotro-tools by dmorcellet.
the class DeedsContainer method writeSortedDeeds.
/**
* Write a XML file with a sorted list of deeds.
* @param deeds Deeds to sort and write.
* @param out Output file.
*/
public static void writeSortedDeeds(List<DeedDescription> deeds, File out) {
List<Comparator<DeedDescription>> comparators = new ArrayList<Comparator<DeedDescription>>();
comparators.add(new DeedNameComparator());
comparators.add(new DeedDescriptionComparator());
CompoundComparator<DeedDescription> comparator = new CompoundComparator<DeedDescription>(comparators);
Collections.sort(deeds, comparator);
DeedXMLWriter writer = new DeedXMLWriter();
writer.writeDeeds(out, deeds, EncodingNames.UTF_8);
}
use of delta.games.lotro.lore.deeds.io.xml.DeedXMLWriter in project lotro-tools by dmorcellet.
the class DeedsFileBuilder method doIt.
private void doIt() {
File loreDir = LotroCoreConfig.getInstance().getLoreDir();
File deedsDir = new File(loreDir, "deeds");
List<DeedDescription> deeds = new ArrayList<DeedDescription>();
DeedXMLParser parser = new DeedXMLParser();
for (File deedFile : deedsDir.listFiles()) {
List<DeedDescription> newDeeds = parser.parseXML(deedFile);
deeds.addAll(newDeeds);
}
File out = new File(loreDir, "deeds.xml");
DeedXMLWriter writer = new DeedXMLWriter();
writer.writeDeeds(out, deeds, EncodingNames.UTF_8);
}
Aggregations