Search in sources :

Example 6 with Rewards

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);
        }
    }
}
Also used : JPanel(javax.swing.JPanel) DeedsManager(delta.games.lotro.lore.deeds.DeedsManager) DeedDescription(delta.games.lotro.lore.deeds.DeedDescription) BorderLayout(java.awt.BorderLayout) JFrame(javax.swing.JFrame) Rewards(delta.games.lotro.common.Rewards) ObjectsSet(delta.games.lotro.common.objects.ObjectsSet)

Example 7 with Rewards

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 + "]");
        }
    }
}
Also used : ObjectItem(delta.games.lotro.common.objects.ObjectItem) Item(delta.games.lotro.lore.items.Item) ObjectItem(delta.games.lotro.common.objects.ObjectItem) Rewards(delta.games.lotro.common.Rewards) ObjectsSet(delta.games.lotro.common.objects.ObjectsSet)

Example 8 with Rewards

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);
            }
        }
    }
}
Also used : ObjectItem(delta.games.lotro.common.objects.ObjectItem) Item(delta.games.lotro.lore.items.Item) ObjectItem(delta.games.lotro.common.objects.ObjectItem) Rewards(delta.games.lotro.common.Rewards) ObjectsSet(delta.games.lotro.common.objects.ObjectsSet)

Example 9 with Rewards

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);
    }
}
Also used : ObjectItem(delta.games.lotro.common.objects.ObjectItem) Rewards(delta.games.lotro.common.Rewards) ObjectsSet(delta.games.lotro.common.objects.ObjectsSet)

Example 10 with Rewards

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();
    }
}
Also used : Rewards(delta.games.lotro.common.Rewards) ObjectsSet(delta.games.lotro.common.objects.ObjectsSet)

Aggregations

Rewards (delta.games.lotro.common.Rewards)11 ObjectsSet (delta.games.lotro.common.objects.ObjectsSet)6 DeedDescription (delta.games.lotro.lore.deeds.DeedDescription)5 ObjectItem (delta.games.lotro.common.objects.ObjectItem)4 DeedsManager (delta.games.lotro.lore.deeds.DeedsManager)3 ArrayList (java.util.ArrayList)3 CharacterLogItem (delta.games.lotro.character.log.CharacterLogItem)2 Title (delta.games.lotro.common.Title)2 Virtue (delta.games.lotro.common.Virtue)2 VirtueId (delta.games.lotro.common.VirtueId)2 DeedProxy (delta.games.lotro.lore.deeds.DeedProxy)2 Item (delta.games.lotro.lore.items.Item)2 List (java.util.List)2 CharacterFile (delta.games.lotro.character.CharacterFile)1 CharacterLog (delta.games.lotro.character.log.CharacterLog)1 LotroTestUtils (delta.games.lotro.character.log.LotroTestUtils)1 Emote (delta.games.lotro.common.Emote)1 ReputationItem (delta.games.lotro.common.ReputationItem)1 Trait (delta.games.lotro.common.Trait)1 QuestDescription (delta.games.lotro.lore.quests.QuestDescription)1