use of delta.games.lotro.character.stats.tomes.TomesSet in project lotro-companion by dmorcellet.
the class TomesEditionPanelController method buildTomesControllers.
private void buildTomesControllers(JPanel panel) {
TomesSet tomes = _toon.getTomes();
for (STAT stat : TomesSet.AVAILABLE_TOMES) {
TomeIconController controller = buildTomeController(tomes, stat);
_tomeControllers.add(controller);
}
}
use of delta.games.lotro.character.stats.tomes.TomesSet in project lotro-companion by dmorcellet.
the class TomesEditionPanelController method updateTier.
private void updateTier(int index, int delta) {
TomesSet tomes = _toon.getTomes();
STAT stat = TomesSet.AVAILABLE_TOMES[index];
int currentTierIndex = tomes.getTomeRank(stat);
currentTierIndex += delta;
if (currentTierIndex > TomesSet.MAX_RANK) {
currentTierIndex = 0;
}
if (currentTierIndex < 0) {
currentTierIndex = TomesSet.MAX_RANK;
}
tomes.setTomeRank(stat, currentTierIndex);
_tomeControllers.get(index).update();
// Broadcast toon update event...
CharacterEvent event = new CharacterEvent(CharacterEventType.CHARACTER_DATA_UPDATED, null, _toon);
EventsManager.invokeEvent(event);
}
use of delta.games.lotro.character.stats.tomes.TomesSet in project lotro-companion by dmorcellet.
the class MainTestTomesEditionPanel method main.
/**
* Basic main method for test.
* @param args Not used.
*/
public static void main(String[] args) {
CharacterData c = new CharacterData();
TomesSet tomes = c.getTomes();
tomes.setTomeRank(STAT.MIGHT, 5);
TomesEditionPanelController controller = new TomesEditionPanelController(c);
JFrame frame = new JFrame("Tomes edition");
frame.add(controller.getPanel());
frame.pack();
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
frame.setVisible(true);
}
Aggregations