use of delta.games.lotro.lore.deeds.DeedDescription in project lotro-tools by dmorcellet.
the class CheckDeedLinks method checkParentDeed.
private void checkParentDeed(DeedDescription deed) {
List<DeedProxy> childProxies = deed.getChildDeedProxies().getDeedProxies();
for (DeedProxy childProxy : childProxies) {
DeedDescription childDeed = childProxy.getDeed();
DeedProxies parentProxies = childDeed.getParentDeedProxies();
DeedProxy parentProxy = parentProxies.getByKey(deed.getKey());
if (parentProxy == null) {
parentProxy = new DeedProxy();
parentProxy.setDeed(deed);
parentProxy.setKey(deed.getKey());
parentProxy.setName(deed.getName());
parentProxies.add(parentProxy);
// System.out.println("Added link from "+childDeed.getKey()+" to "+deed.getKey());
}
}
}
use of delta.games.lotro.lore.deeds.DeedDescription in project lotro-tools by dmorcellet.
the class CheckDeedLinks method loadPreviousDeeds.
private Set<String> loadPreviousDeeds(DeedDescription deed) {
Set<String> previousDeeds = new HashSet<String>();
DeedProxy previousProxy = deed.getPreviousDeedProxy();
while (previousProxy != null) {
String key = previousProxy.getKey();
previousDeeds.add(key);
DeedDescription previousDeed = previousProxy.getDeed();
if (previousDeed != null) {
previousProxy = previousDeed.getPreviousDeedProxy();
} else {
previousProxy = null;
}
}
return previousDeeds;
}
use of delta.games.lotro.lore.deeds.DeedDescription in project lotro-tools by dmorcellet.
the class DeedLinksResolver method resolveDeedProxy.
private void resolveDeedProxy(DeedProxy proxy) {
if (proxy == null)
return;
// Already resolved
if (proxy.getKey() != null)
return;
String deedName = proxy.getName();
deedName = deedName.replace(" ", " ");
if (deedName.endsWith("\u200e")) {
deedName = deedName.substring(0, deedName.length() - 1);
}
DeedDescription proxiedDeed = _mapByName.get(deedName);
if (proxiedDeed != null) {
proxy.setName(deedName);
proxy.setDeed(proxiedDeed);
proxy.setKey(proxiedDeed.getKey());
} else {
boolean ok = false;
if (deedName.endsWith(" (Advanced)")) {
String baseDeedName = deedName.substring(0, deedName.length() - 10).trim();
DeedDescription baseDeed = _mapByName.get(baseDeedName);
if (baseDeed != null) {
DeedDescription advancedDeed = buildAdvancedSkirmishLieutenantDeed(baseDeed);
_toAdd.add(advancedDeed);
ok = true;
}
}
if (!ok) {
System.out.println("Deed not found: " + deedName);
}
}
}
use of delta.games.lotro.lore.deeds.DeedDescription in project lotro-tools by dmorcellet.
the class DeedLinksResolver method doIt.
/**
* Do resolve links.
*/
public void doIt() {
// Resolve deed links
for (DeedDescription deed : _deeds) {
resolveDeed(deed);
}
// Add all missing deeds
_deeds.addAll(_toAdd);
// Load a map by key
loadMapByKey();
DeedObjectivesParser objectivesParser = new DeedObjectivesParser(_mapByName, _mapByKey);
// Find additional links in objectives
for (DeedDescription deed : _deeds) {
objectivesParser.doIt(deed);
}
// Remove useless children
for (DeedDescription deed : _deeds) {
removeUnwantedChildren(deed);
checkForUnwantedChildren(deed);
}
// Remove duplicates
{
_deeds.remove(_mapByKey.get("Ten_Years_of_Trifles_(Deed)"));
_deeds.remove(_mapByKey.get("Threat_of_the_Wastes"));
}
// Check link symetry
for (DeedDescription deed : _deeds) {
checkDeedSymetry(deed);
}
}
use of delta.games.lotro.lore.deeds.DeedDescription in project lotro-tools by dmorcellet.
the class DeedLinksResolver method loadMapByName.
private void loadMapByName() {
_mapByName = new HashMap<String, DeedDescription>();
for (DeedDescription deed : _deeds) {
String name = deed.getName();
DeedDescription old = _mapByName.put(name, deed);
if (old != null) {
System.out.println("Multiple instances of deed name: " + name);
}
}
}
Aggregations