Search in sources :

Example 6 with Virtue

use of delta.games.lotro.common.Virtue 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

Virtue (delta.games.lotro.common.Virtue)6 VirtueId (delta.games.lotro.common.VirtueId)6 Rewards (delta.games.lotro.common.Rewards)2 DeedDescription (delta.games.lotro.lore.deeds.DeedDescription)2 ArrayList (java.util.ArrayList)2 CharacterFile (delta.games.lotro.character.CharacterFile)1 CharacterLog (delta.games.lotro.character.log.CharacterLog)1 LotroTestUtils (delta.games.lotro.character.log.LotroTestUtils)1 ReputationItem (delta.games.lotro.common.ReputationItem)1 Title (delta.games.lotro.common.Title)1 Trait (delta.games.lotro.common.Trait)1 ObjectItem (delta.games.lotro.common.objects.ObjectItem)1 ObjectsSet (delta.games.lotro.common.objects.ObjectsSet)1 DeedProxy (delta.games.lotro.lore.deeds.DeedProxy)1 DeedsManager (delta.games.lotro.lore.deeds.DeedsManager)1 Faction (delta.games.lotro.lore.reputation.Faction)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 Element (net.htmlparser.jericho.Element)1