Search in sources :

Example 1 with DeedXMLParser

use of delta.games.lotro.lore.deeds.io.xml.DeedXMLParser in project lotro-tools by dmorcellet.

the class DeedsContainer method load.

private void load() {
    DeedXMLParser parser = new DeedXMLParser();
    _deeds = parser.parseXML(_deedsFile);
    resolveProxies();
}
Also used : DeedXMLParser(delta.games.lotro.lore.deeds.io.xml.DeedXMLParser)

Example 2 with DeedXMLParser

use of delta.games.lotro.lore.deeds.io.xml.DeedXMLParser 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);
}
Also used : DeedDescription(delta.games.lotro.lore.deeds.DeedDescription) ArrayList(java.util.ArrayList) DeedXMLWriter(delta.games.lotro.lore.deeds.io.xml.DeedXMLWriter) File(java.io.File) DeedXMLParser(delta.games.lotro.lore.deeds.io.xml.DeedXMLParser)

Example 3 with DeedXMLParser

use of delta.games.lotro.lore.deeds.io.xml.DeedXMLParser in project lotro-tools by dmorcellet.

the class LorebookDeedsDatabaseNormalization method doIt.

private void doIt() {
    File loreDir = LotroCoreConfig.getInstance().getLoreDir();
    File in = new File(loreDir, "deeds.xml");
    DeedXMLParser parser = new DeedXMLParser();
    List<DeedDescription> deeds = parser.parseXML(in);
    for (DeedDescription deed : deeds) {
        normalizeDeed(deed);
    }
    File out = new File(loreDir, "deeds_by_name.xml");
    DeedsContainer.writeSortedDeeds(deeds, out);
}
Also used : DeedDescription(delta.games.lotro.lore.deeds.DeedDescription) File(java.io.File) DeedXMLParser(delta.games.lotro.lore.deeds.io.xml.DeedXMLParser)

Example 4 with DeedXMLParser

use of delta.games.lotro.lore.deeds.io.xml.DeedXMLParser in project lotro-tools by dmorcellet.

the class MainLotroWikiDeedsLoader method writeResultFile.

private void writeResultFile() {
    List<DeedDescription> deeds = new ArrayList<DeedDescription>();
    DeedXMLParser parser = new DeedXMLParser();
    File currentDir = new File(".");
    for (File deedFile : currentDir.listFiles()) {
        if (deedFile.getName().endsWith(".xml")) {
            List<DeedDescription> newDeeds = parser.parseXML(deedFile);
            deeds.addAll(newDeeds);
        }
    }
    // Resolve deed links
    new DeedLinksResolver(deeds).doIt();
    int nbDeeds = deeds.size();
    System.out.println("Found " + nbDeeds + " deeds.");
    new CheckItemRewardsInDeeds().doIt(deeds);
    new NormalizeDeedsText().doIt(deeds);
    new CheckDeedLinks().doIt(deeds);
    File out = new File("../lotro-companion/data/lore/deeds.xml");
    DeedsContainer.writeSortedDeeds(deeds, out);
}
Also used : DeedDescription(delta.games.lotro.lore.deeds.DeedDescription) CheckItemRewardsInDeeds(delta.games.lotro.tools.lore.deeds.checks.CheckItemRewardsInDeeds) ArrayList(java.util.ArrayList) NormalizeDeedsText(delta.games.lotro.tools.lore.deeds.checks.NormalizeDeedsText) File(java.io.File) DeedXMLParser(delta.games.lotro.lore.deeds.io.xml.DeedXMLParser) CheckDeedLinks(delta.games.lotro.tools.lore.deeds.checks.CheckDeedLinks)

Aggregations

DeedXMLParser (delta.games.lotro.lore.deeds.io.xml.DeedXMLParser)4 DeedDescription (delta.games.lotro.lore.deeds.DeedDescription)3 File (java.io.File)3 ArrayList (java.util.ArrayList)2 DeedXMLWriter (delta.games.lotro.lore.deeds.io.xml.DeedXMLWriter)1 CheckDeedLinks (delta.games.lotro.tools.lore.deeds.checks.CheckDeedLinks)1 CheckItemRewardsInDeeds (delta.games.lotro.tools.lore.deeds.checks.CheckItemRewardsInDeeds)1 NormalizeDeedsText (delta.games.lotro.tools.lore.deeds.checks.NormalizeDeedsText)1