use of delta.games.lotro.common.Rewards in project lotro-companion by dmorcellet.
the class MainTestRewardsDisplay method main.
/**
* Main method for this test.
* @param args Not used.
*/
public static void main(String[] args) {
DeedsManager deedsManager = DeedsManager.getInstance();
List<DeedDescription> deeds = deedsManager.getAll();
for (int i = 0; i < 50; i++) {
DeedDescription deed = deeds.get(i);
Rewards rewards = deed.getRewards();
ObjectsSet objects = rewards.getObjects();
int lotroPoints = rewards.getLotroPoints();
if ((objects.getNbObjectItems() > 0) || (lotroPoints > 0)) {
RewardsPanelController panelCtrl = new RewardsPanelController(rewards);
JPanel panel = panelCtrl.getPanel();
JFrame frame = new JFrame();
JPanel background = GuiFactory.buildBackgroundPanel(new BorderLayout());
background.add(panel, BorderLayout.CENTER);
frame.add(background);
frame.pack();
frame.setVisible(true);
}
}
}
use of delta.games.lotro.common.Rewards in project lotro-tools by dmorcellet.
the class LorebookDeedsDatabaseNormalization method normalizeDeed.
private void normalizeDeed(DeedDescription deed) {
// Remove key
deed.setKey(null);
// Normalize EOL/LF
// - description
deed.setDescription(normalizeText(deed.getDescription()));
// - objectives
deed.setObjectives(normalizeText(deed.getObjectives()));
// Find item IDs
// TODO Use ItemsResolver
Rewards rewards = deed.getRewards();
ObjectsSet objects = rewards.getObjects();
int nbItems = objects.getNbObjectItems();
for (int i = 0; i < nbItems; i++) {
ObjectItem objectItem = objects.getItem(i);
String name = objectItem.getName();
Item item = getItemByName(name);
if (item != null) {
objectItem.setItemId(item.getIdentifier());
objectItem.setObjectURL(null);
objectItem.setIconURL(null);
} else {
System.out.println("Item not found [" + name + "]");
}
}
}
use of delta.games.lotro.common.Rewards in project lotro-tools by dmorcellet.
the class CheckItemRewardsInDeeds method handleDeed.
private void handleDeed(DeedDescription deed) {
Rewards rewards = deed.getRewards();
ObjectsSet objects = rewards.getObjects();
int nbItems = objects.getNbObjectItems();
for (int i = 0; i < nbItems; i++) {
ObjectItem objectItem = objects.getItem(i);
int id = objectItem.getItemId();
String name = objectItem.getName();
Item item = ItemsManager.getInstance().getItem(id);
if (item == null) {
System.out.println("Item not found: id=" + id + ", name=" + name);
} else {
String itemName = item.getName();
if (!Objects.equals(name, itemName)) {
System.out.println("Fix item reward name from [" + name + "] to [" + itemName + "]");
objectItem.setName(itemName);
}
}
}
}
use of delta.games.lotro.common.Rewards in project lotro-tools by dmorcellet.
the class LotroWikiDeedCategoryPageParser method resolveItemRewards.
private void resolveItemRewards(DeedDescription deed) {
Rewards rewards = deed.getRewards();
ObjectsSet objects = rewards.getObjects();
int nbItems = objects.getNbObjectItems();
for (int i = 0; i < nbItems; i++) {
ObjectItem objectItem = objects.getItem(i);
resolveItem(objectItem);
}
}
use of delta.games.lotro.common.Rewards in project lotro-tools by dmorcellet.
the class QuestsItemsLoader method handleQuest.
private void handleQuest(int index, QuestDescription q) {
try {
// String key=q.getKey();
// System.out.println("#"+index+", quest: "+key);
Rewards r = q.getQuestRewards();
ObjectsSet set = r.getObjects();
handleSet(set);
ObjectsSet set2 = r.getSelectObjects();
handleSet(set2);
} catch (Throwable t) {
t.printStackTrace();
}
}
Aggregations