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