use of delta.games.lotro.lore.deeds.DeedProxy 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.DeedProxy 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.DeedProxy in project lotro-tools by dmorcellet.
the class DeedLinksResolver method buildAdvancedSkirmishLieutenantDeed.
private DeedDescription buildAdvancedSkirmishLieutenantDeed(DeedDescription baseDeed) {
DeedDescription deed = new DeedDescription();
deed.setKey(baseDeed.getKey() + "_(Advanced)");
deed.setName(baseDeed.getName() + " (Advanced)");
deed.setType(DeedType.SLAYER);
deed.setCategory(baseDeed.getCategory());
deed.setDescription(baseDeed.getDescription());
// Objectives
// First line of base deed, replace (5) by (50)
{
String newObjectives = "";
String objectives = baseDeed.getObjectives();
int index = objectives.indexOf('\n');
if (index != -1) {
newObjectives = objectives.substring(0, index);
} else {
newObjectives = objectives;
}
newObjectives = newObjectives.replace("(5)", "(50)");
deed.setObjectives(newObjectives);
}
// Previous
DeedProxy previous = new DeedProxy();
previous.setDeed(baseDeed);
previous.setKey(previous.getKey());
previous.setName(previous.getName());
deed.setPreviousDeedProxy(previous);
// Rewards
ObjectItem item = new ObjectItem("Mark");
item.setItemId(1879224343);
deed.getRewards().getObjects().addObject(item, 500);
return deed;
}
use of delta.games.lotro.lore.deeds.DeedProxy in project lotro-tools by dmorcellet.
the class DeedLinksResolver method checkPrevious2NextSymetry.
private void checkPrevious2NextSymetry(DeedDescription deed) {
DeedProxy previousProxy = deed.getPreviousDeedProxy();
if (previousProxy != null) {
String previousKey = previousProxy.getKey();
DeedDescription previousDeed = _mapByKey.get(previousKey);
if (previousDeed != null) {
DeedProxy nextProxy = previousDeed.getPreviousDeedProxy();
if (nextProxy == null) {
nextProxy = new DeedProxy();
nextProxy.setDeed(deed);
nextProxy.setKey(deed.getKey());
nextProxy.setName(deed.getName());
previousDeed.setNextDeedProxy(nextProxy);
}
}
}
}
use of delta.games.lotro.lore.deeds.DeedProxy in project lotro-tools by dmorcellet.
the class DeedLinksResolver method addChildDeed.
/**
* Add child deed, if it does not exist.
* @param parentDeed Parent deed.
* @param childDeed Child deed.
*/
public static void addChildDeed(DeedDescription parentDeed, DeedDescription childDeed) {
// Ignore links to self!
if (parentDeed.getName().equals(childDeed.getName())) {
return;
}
// Find child
DeedProxy foundDeed = parentDeed.getChildDeedProxies().getByKey(childDeed.getKey());
boolean found = (foundDeed != null);
// Add it if it is not found!
if (!found) {
DeedProxy childProxy = new DeedProxy();
childProxy.setDeed(childDeed);
childProxy.setKey(childDeed.getKey());
childProxy.setName(childDeed.getName());
parentDeed.getChildDeedProxies().add(childProxy);
}
}
Aggregations