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);
}
}
}
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);
}
}
}
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);
}
}
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;
}
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;
}
Aggregations