use of delta.games.lotro.lore.deeds.DeedsManager 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.lore.deeds.DeedsManager in project lotro-companion by dmorcellet.
the class VirtuesStats method parseDeedItems.
private void parseDeedItems(List<CharacterLogItem> items) {
DeedsManager dm = DeedsManager.getInstance();
for (CharacterLogItem item : items) {
Integer id = item.getResourceIdentifier();
if (id != null) {
DeedDescription deed = dm.getDeed(id.intValue());
if (deed != null) {
Rewards rewards = deed.getRewards();
String name = deed.getName();
handleRewards("Deed:" + name, rewards);
}
}
}
}
use of delta.games.lotro.lore.deeds.DeedsManager in project lotro-companion by dmorcellet.
the class DeedsTableController method init.
private void init() {
reset();
DeedsManager manager = DeedsManager.getInstance();
List<DeedDescription> deeds = manager.getAll();
for (DeedDescription deed : deeds) {
_deeds.add(deed);
}
}
use of delta.games.lotro.lore.deeds.DeedsManager 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);
}
}
}
Aggregations