Search in sources :

Example 1 with RelicsCategory

use of delta.games.lotro.lore.items.legendary.relics.RelicsCategory in project lotro-tools by dmorcellet.

the class BuildRelicsIconsDb method doIt.

private void doIt() {
    System.out.println("Output dir: " + _toDir);
    RelicsManager relicsMgr = RelicsManager.getInstance();
    List<String> categories = relicsMgr.getCategories();
    for (String categoryName : categories) {
        RelicsCategory category = relicsMgr.getRelicCategory(categoryName, false);
        List<Relic> relics = category.getAllRelics();
        for (Relic relic : relics) {
            checkRelic(relic);
        }
    }
}
Also used : Relic(delta.games.lotro.lore.items.legendary.relics.Relic) RelicsCategory(delta.games.lotro.lore.items.legendary.relics.RelicsCategory) RelicsManager(delta.games.lotro.lore.items.legendary.relics.RelicsManager)

Example 2 with RelicsCategory

use of delta.games.lotro.lore.items.legendary.relics.RelicsCategory in project lotro-tools by dmorcellet.

the class RelicsIndexPageParser method addGorgorothRelics.

private void addGorgorothRelics(RelicsManager relicsMgr) {
    RelicsCategory category = findGorgorothCategory(relicsMgr);
    if (category != null) {
        LotroPlanMordorRelicsLoader relicsLoader = new LotroPlanMordorRelicsLoader();
        List<Relic> relics = relicsLoader.loadGorgorothRelics();
        for (Relic relic : relics) {
            String name = relic.getName();
            Relic oldOne = category.getByName(name);
            if (oldOne != null) {
                mergeRelics(oldOne, relic);
            } else {
                category.addRelic(relic);
            }
        }
    }
}
Also used : Relic(delta.games.lotro.lore.items.legendary.relics.Relic) RelicsCategory(delta.games.lotro.lore.items.legendary.relics.RelicsCategory) LotroPlanMordorRelicsLoader(delta.games.lotro.tools.lore.items.lotroplan.relics.LotroPlanMordorRelicsLoader)

Example 3 with RelicsCategory

use of delta.games.lotro.lore.items.legendary.relics.RelicsCategory in project lotro-tools by dmorcellet.

the class RelicsIndexPageParser method handleTable.

private void handleTable(String categoryName, Segment source, String id, Integer level, RelicType defaultType) {
    Element table = findRelicsTable(source, id);
    if (table != null) {
        RelicsCategory category = _relicsMgr.getRelicCategory(categoryName, true);
        List<Element> trs = JerichoHtmlUtils.findElementsByTagName(table, HTMLElementName.TR);
        for (Element tr : trs) {
            Relic relic = handleTableRow(tr, level, defaultType);
            if (relic != null) {
                category.addRelic(relic);
            }
        }
    } else {
        System.err.println("Cannot find table: " + id);
    }
}
Also used : Relic(delta.games.lotro.lore.items.legendary.relics.Relic) RelicsCategory(delta.games.lotro.lore.items.legendary.relics.RelicsCategory) Element(net.htmlparser.jericho.Element)

Aggregations

Relic (delta.games.lotro.lore.items.legendary.relics.Relic)3 RelicsCategory (delta.games.lotro.lore.items.legendary.relics.RelicsCategory)3 RelicsManager (delta.games.lotro.lore.items.legendary.relics.RelicsManager)1 LotroPlanMordorRelicsLoader (delta.games.lotro.tools.lore.items.lotroplan.relics.LotroPlanMordorRelicsLoader)1 Element (net.htmlparser.jericho.Element)1