Search in sources :

Example 1 with TomesSet

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);
    }
}
Also used : STAT(delta.games.lotro.character.stats.STAT) TomesSet(delta.games.lotro.character.stats.tomes.TomesSet)

Example 2 with TomesSet

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);
}
Also used : STAT(delta.games.lotro.character.stats.STAT) CharacterEvent(delta.games.lotro.character.events.CharacterEvent) TomesSet(delta.games.lotro.character.stats.tomes.TomesSet)

Example 3 with TomesSet

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);
}
Also used : CharacterData(delta.games.lotro.character.CharacterData) JFrame(javax.swing.JFrame) TomesSet(delta.games.lotro.character.stats.tomes.TomesSet)

Aggregations

TomesSet (delta.games.lotro.character.stats.tomes.TomesSet)3 STAT (delta.games.lotro.character.stats.STAT)2 CharacterData (delta.games.lotro.character.CharacterData)1 CharacterEvent (delta.games.lotro.character.events.CharacterEvent)1 JFrame (javax.swing.JFrame)1