Search in sources :

Example 1 with CharacterLog

use of delta.games.lotro.character.log.CharacterLog in project lotro-companion by dmorcellet.

the class MainTestQuestCompletionStats method main.

/**
 * Basic main method for test.
 * @param args Not used.
 */
public static void main(String[] args) {
    LotroTestUtils utils = new LotroTestUtils();
    // CharacterFile mainToon=utils.getMainToon();
    CharacterFile mainToon = utils.getToonByName("Feroce");
    CharacterSummary summary = mainToon.getSummary();
    CharacterLog log = mainToon.getLastCharacterLog();
    if (log != null) {
        QuestsManager qm = QuestsManager.getInstance();
        QuestsIndex index = qm.getIndex();
        String[] categories = index.getCategories();
        for (String category : categories) {
            // String category="Epic - Vol. I, Book 1: Stirrings in the Darkness";
            QuestsCompletionStats stats = new QuestsCompletionStats(category, summary, log);
            stats.dump(System.out, true);
        }
    }
}
Also used : CharacterSummary(delta.games.lotro.character.CharacterSummary) LotroTestUtils(delta.games.lotro.character.log.LotroTestUtils) QuestsManager(delta.games.lotro.lore.quests.QuestsManager) CharacterFile(delta.games.lotro.character.CharacterFile) QuestsIndex(delta.games.lotro.lore.quests.index.QuestsIndex) CharacterLog(delta.games.lotro.character.log.CharacterLog)

Example 2 with CharacterLog

use of delta.games.lotro.character.log.CharacterLog in project lotro-companion by dmorcellet.

the class MainTestVirtuesStats method main.

/**
 * Basic main method for test.
 * @param args Not used.
 */
public static void main(String[] args) {
    LotroTestUtils utils = new LotroTestUtils();
    CharacterFile mainToon = utils.getMainToon();
    // CharacterFile mainToon=utils.getToonByName("Feroce");
    CharacterLog log = mainToon.getLastCharacterLog();
    VirtuesStats stats = null;
    if (log != null) {
        stats = new VirtuesStats(log);
        stats.dump(System.out, true);
    }
    HashMap<VirtueId, List<String>> virtuesMap = new HashMap<VirtueId, List<String>>();
    {
        DeedsManager dm = DeedsManager.getInstance();
        List<DeedDescription> deeds = dm.getAll();
        for (DeedDescription deed : deeds) {
            String name = deed.getName();
            Rewards rewards = deed.getRewards();
            Virtue[] virtues = rewards.getVirtues();
            if (virtues != null) {
                for (Virtue virtue : virtues) {
                    VirtueId virtueId = virtue.getIdentifier();
                    List<String> items = virtuesMap.get(virtueId);
                    if (items == null) {
                        items = new ArrayList<String>();
                        virtuesMap.put(virtueId, items);
                    }
                    items.add("Deed:" + name);
                }
            }
        }
    }
    List<String> toShow = new ArrayList<String>();
    toShow.add("Valour");
    toShow.add("Loyalty");
    toShow.add("Justice");
    toShow.add("Honour");
    toShow.add("Innocence");
    toShow.add("Zeal");
    List<VirtueId> virtueIds = new ArrayList<VirtueId>(virtuesMap.keySet());
    Collections.sort(virtueIds);
    for (VirtueId virtueId : virtueIds) {
        if (toShow.contains(virtueId)) {
            List<String> deeds = virtuesMap.get(virtueId);
            System.out.println(virtueId + " (" + deeds.size() + "): " + deeds);
            String[] got = stats.getIDsForAVirtue(virtueId);
            if (got != null) {
                System.out.println("GOT:" + virtueId + " (" + got.length + "): " + Arrays.toString(got));
                for (String id : got) deeds.remove(id);
            }
            System.out.println("MISSING: " + virtueId + " (" + deeds.size() + "): " + deeds);
        }
    }
}
Also used : DeedDescription(delta.games.lotro.lore.deeds.DeedDescription) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) CharacterFile(delta.games.lotro.character.CharacterFile) DeedsManager(delta.games.lotro.lore.deeds.DeedsManager) LotroTestUtils(delta.games.lotro.character.log.LotroTestUtils) VirtueId(delta.games.lotro.common.VirtueId) Rewards(delta.games.lotro.common.Rewards) Virtue(delta.games.lotro.common.Virtue) ArrayList(java.util.ArrayList) List(java.util.List) CharacterLog(delta.games.lotro.character.log.CharacterLog)

Example 3 with CharacterLog

use of delta.games.lotro.character.log.CharacterLog in project lotro-companion by dmorcellet.

the class MainTestWarbandStats method main.

/**
 * Basic main method for test.
 * @param args Not used.
 */
public static void main(String[] args) {
    LotroTestUtils utils = new LotroTestUtils();
    CharacterFile toon = utils.getToonByName("Allyriel");
    CharacterLog log = toon.getLastCharacterLog();
    if (log != null) {
        WarbandsStats stats = new WarbandsStats(log);
        stats.dump(System.out);
    }
}
Also used : LotroTestUtils(delta.games.lotro.character.log.LotroTestUtils) CharacterFile(delta.games.lotro.character.CharacterFile) CharacterLog(delta.games.lotro.character.log.CharacterLog)

Example 4 with CharacterLog

use of delta.games.lotro.character.log.CharacterLog in project lotro-companion by dmorcellet.

the class CharacterLogWindowController method buildContents.

@Override
protected JComponent buildContents() {
    CharacterLog log = getLog();
    JPanel logPanel = GuiFactory.buildPanel(new GridBagLayout());
    _tableController = new CharacterLogTableController(log, _filter);
    // Log frame
    _panelController = new CharacterLogPanelController(_tableController);
    JPanel tablePanel = _panelController.getPanel();
    // Filter
    _filterController = new CharacterLogFilterController(log, _filter, _panelController);
    JPanel filterPanel = _filterController.getPanel();
    TitledBorder filterBorder = GuiFactory.buildTitledBorder("Filter");
    filterPanel.setBorder(filterBorder);
    // Whole panel
    GridBagConstraints c = new GridBagConstraints(0, 0, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0);
    logPanel.add(filterPanel, c);
    c.gridy = 1;
    c.weighty = 1;
    c.fill = GridBagConstraints.BOTH;
    logPanel.add(tablePanel, c);
    return logPanel;
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) TitledBorder(javax.swing.border.TitledBorder) CharacterLog(delta.games.lotro.character.log.CharacterLog)

Example 5 with CharacterLog

use of delta.games.lotro.character.log.CharacterLog in project lotro-tools by dmorcellet.

the class CharacterLogPageParser method parseLogPages.

/**
 * Parse the character page at the given URL.
 * @param url URL of character page.
 * @param stopDate Ignore items strictly before the given date.
 * <code>null</code> means no filtering.
 * @return A character or <code>null</code> if an error occurred..
 */
public CharacterLog parseLogPages(String url, Long stopDate) {
    _characterName = null;
    _stopDate = stopDate;
    _stop = false;
    String rootURL = url + "/activitylog?cl%5Bpp%5D";
    int nbPages = parseFirstPage(rootURL);
    CharacterLog log = null;
    if (nbPages > 0) {
        log = new CharacterLog("");
        for (int i = 1; i <= nbPages; i++) {
            parseLogPage(log, rootURL, i);
            if (_stop) {
                break;
            }
        }
        if (_characterName != null) {
            log.setName(_characterName);
        }
    // TODO set character name even if there's no log entry (e.g Aerael)
    }
    return log;
}
Also used : CharacterLog(delta.games.lotro.character.log.CharacterLog)

Aggregations

CharacterLog (delta.games.lotro.character.log.CharacterLog)9 CharacterFile (delta.games.lotro.character.CharacterFile)5 LotroTestUtils (delta.games.lotro.character.log.LotroTestUtils)5 MyLotroConfig (delta.games.lotro.MyLotroConfig)2 CharacterLogsManager (delta.games.lotro.character.log.CharacterLogsManager)2 ArrayList (java.util.ArrayList)2 CharacterSummary (delta.games.lotro.character.CharacterSummary)1 Rewards (delta.games.lotro.common.Rewards)1 Virtue (delta.games.lotro.common.Virtue)1 VirtueId (delta.games.lotro.common.VirtueId)1 DeedDescription (delta.games.lotro.lore.deeds.DeedDescription)1 DeedsManager (delta.games.lotro.lore.deeds.DeedsManager)1 QuestsManager (delta.games.lotro.lore.quests.QuestsManager)1 QuestsIndex (delta.games.lotro.lore.quests.index.QuestsIndex)1 WarbandsStats (delta.games.lotro.stats.warbands.WarbandsStats)1 GridBagConstraints (java.awt.GridBagConstraints)1 GridBagLayout (java.awt.GridBagLayout)1 Insets (java.awt.Insets)1 HashMap (java.util.HashMap)1 List (java.util.List)1