use of delta.games.lotro.lore.deeds.DeedDescription 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.DeedDescription 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.DeedDescription in project lotro-companion by dmorcellet.
the class DeedUtils method getCategories.
/**
* Load available categories from deeds manager.
* @return A sorted list of deed categories.
*/
public static List<String> getCategories() {
Set<String> categories = new HashSet<String>();
List<DeedDescription> deeds = DeedsManager.getInstance().getAll();
for (DeedDescription deed : deeds) {
categories.add(deed.getCategory());
}
List<String> ret = new ArrayList<String>(categories);
ret.remove(null);
Collections.sort(ret);
return ret;
}
use of delta.games.lotro.lore.deeds.DeedDescription in project lotro-companion by dmorcellet.
the class DeedsExplorerWindowController method initDeedsTable.
private void initDeedsTable() {
TypedProperties prefs = GlobalPreferences.getGlobalProperties("DeedsExplorer");
_tableController = new DeedsTableController(prefs, _filter);
ActionListener al = new ActionListener() {
@Override
public void actionPerformed(ActionEvent event) {
String action = event.getActionCommand();
if (DeedsTableController.DOUBLE_CLICK.equals(action)) {
DeedDescription deed = (DeedDescription) event.getSource();
DeedDisplayWindowController window = new DeedDisplayWindowController(DeedsExplorerWindowController.this);
window.setDeed(deed);
window.show(false);
}
}
};
_tableController.addActionListener(al);
}
use of delta.games.lotro.lore.deeds.DeedDescription 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);
}
}
Aggregations