Search in sources :

Example 1 with TraitPointLabelComparator

use of delta.games.lotro.stats.traitPoints.comparators.TraitPointLabelComparator in project lotro-tools by dmorcellet.

the class TraitPointsRegistryBuilder method checks.

private void checks() {
    for (CharacterClass cClass : CharacterClass.ALL_CLASSES) {
        List<TraitPoint> points = _registry.getPointsForClass(cClass);
        Collections.sort(points, new TraitPointLabelComparator());
        System.out.println(cClass + ":" + points.size());
        for (TraitPoint point : points) {
            System.out.println("\t" + point.getLabel() + " -- " + point.getId());
        }
    }
    List<TraitPoint> all = _registry.getAll();
    System.out.println("All:" + all.size());
}
Also used : TraitPoint(delta.games.lotro.stats.traitPoints.TraitPoint) TraitPointLabelComparator(delta.games.lotro.stats.traitPoints.comparators.TraitPointLabelComparator) CharacterClass(delta.games.lotro.common.CharacterClass)

Example 2 with TraitPointLabelComparator

use of delta.games.lotro.stats.traitPoints.comparators.TraitPointLabelComparator in project lotro-companion by dmorcellet.

the class TraitPointsEditionPanelController method buildTables.

private void buildTables() {
    _tableControllers = new ArrayList<TraitPointsTableController>();
    _labels = new ArrayList<String>();
    CharacterClass characterClass = _summary.getCharacterClass();
    TraitPointsRegistry registry = TraitPoints.get().getRegistry();
    List<TraitPoint> points = registry.getPointsForClass(characterClass);
    Collections.sort(points, new TraitPointLabelComparator());
    TraitPointsStatusListener listener = new TraitPointsStatusListener() {

        @Override
        public void statusUpdated() {
            _summaryController.update();
        }
    };
    String[] categories = { "Class", "Epic", "Quests", "Deeds" };
    for (String category : categories) {
        TraitPointFilter filter = new TraitPointFilter();
        filter.setCategory(category);
        List<TraitPoint> selectedPoints = new ArrayList<TraitPoint>();
        for (TraitPoint point : points) {
            if (filter.accept(point)) {
                selectedPoints.add(point);
            }
        }
        TraitPointsTableController tableController = new TraitPointsTableController(_status, selectedPoints);
        _tableControllers.add(tableController);
        _labels.add(category);
        tableController.setListener(listener);
    }
}
Also used : TraitPointFilter(delta.games.lotro.stats.traitPoints.TraitPointFilter) TraitPoint(delta.games.lotro.stats.traitPoints.TraitPoint) ArrayList(java.util.ArrayList) CharacterClass(delta.games.lotro.common.CharacterClass) TraitPointsRegistry(delta.games.lotro.stats.traitPoints.TraitPointsRegistry) TraitPointLabelComparator(delta.games.lotro.stats.traitPoints.comparators.TraitPointLabelComparator)

Aggregations

CharacterClass (delta.games.lotro.common.CharacterClass)2 TraitPoint (delta.games.lotro.stats.traitPoints.TraitPoint)2 TraitPointLabelComparator (delta.games.lotro.stats.traitPoints.comparators.TraitPointLabelComparator)2 TraitPointFilter (delta.games.lotro.stats.traitPoints.TraitPointFilter)1 TraitPointsRegistry (delta.games.lotro.stats.traitPoints.TraitPointsRegistry)1 ArrayList (java.util.ArrayList)1