Search in sources :

Example 16 with VirtueId

use of delta.games.lotro.common.VirtueId in project lotro-tools by dmorcellet.

the class LotroWikiDeedPageParser method extractVirtue.

private VirtueId extractVirtue(String line) {
    VirtueId virtue = null;
    String virtueName = getLineValue(line);
    if (!virtueName.isEmpty()) {
        virtue = VirtueId.valueOf(virtueName.toUpperCase());
    }
    return virtue;
}
Also used : VirtueId(delta.games.lotro.common.VirtueId)

Example 17 with VirtueId

use of delta.games.lotro.common.VirtueId in project lotro-tools by dmorcellet.

the class LotroWikiDeedPageParser method handleTraitReward.

private void handleTraitReward(Rewards rewards, String traitStr) {
    // Sometimes, a trait is in fact... a virtue!
    VirtueId virtueId = null;
    try {
        virtueId = VirtueId.valueOf(traitStr.toUpperCase());
    } catch (Exception e) {
    // Ignored
    }
    if (virtueId != null) {
        Virtue virtue = new Virtue(virtueId, 1);
        rewards.addVirtue(virtue);
    } else {
        if (traitStr.toLowerCase().endsWith(" (trait)"))
            traitStr = traitStr.substring(0, traitStr.length() - 8);
        if (traitStr.toLowerCase().endsWith(" (beorning trait)"))
            traitStr = traitStr.substring(0, traitStr.length() - 17);
        Trait trait = new Trait(traitStr);
        rewards.addTrait(trait);
    }
}
Also used : VirtueId(delta.games.lotro.common.VirtueId) Virtue(delta.games.lotro.common.Virtue) Trait(delta.games.lotro.common.Trait)

Aggregations

VirtueId (delta.games.lotro.common.VirtueId)17 Virtue (delta.games.lotro.common.Virtue)6 ArrayList (java.util.ArrayList)3 Rewards (delta.games.lotro.common.Rewards)2 VirtueRewardFilter (delta.games.lotro.common.rewards.filters.VirtueRewardFilter)2 DeedDescription (delta.games.lotro.lore.deeds.DeedDescription)2 Faction (delta.games.lotro.lore.reputation.Faction)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 ComboBoxController (delta.common.ui.swing.combobox.ComboBoxController)1 ItemSelectionListener (delta.common.ui.swing.combobox.ItemSelectionListener)1 CharacterFile (delta.games.lotro.character.CharacterFile)1 CharacterLog (delta.games.lotro.character.log.CharacterLog)1 LotroTestUtils (delta.games.lotro.character.log.LotroTestUtils)1 VirtuesSet (delta.games.lotro.character.stats.virtues.VirtuesSet)1 CharacterClass (delta.games.lotro.common.CharacterClass)1 Race (delta.games.lotro.common.Race)1 ReputationItem (delta.games.lotro.common.ReputationItem)1 Title (delta.games.lotro.common.Title)1 Trait (delta.games.lotro.common.Trait)1