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);
}
}
Aggregations