use of com.archyx.aureliumskills.leaderboard.LeaderboardSorter in project AureliumSkills by Archy-X.
the class StorageProvider method sortLeaderboards.
protected void sortLeaderboards(Map<Skill, List<SkillValue>> leaderboards, List<SkillValue> powerLeaderboard, List<SkillValue> averageLeaderboard) {
LeaderboardManager manager = plugin.getLeaderboardManager();
LeaderboardSorter sorter = new LeaderboardSorter();
for (Skill skill : Skills.values()) {
leaderboards.get(skill).sort(sorter);
}
powerLeaderboard.sort(sorter);
AverageSorter averageSorter = new AverageSorter();
averageLeaderboard.sort(averageSorter);
// Add skill leaderboards to map
for (Skill skill : Skills.values()) {
manager.setLeaderboard(skill, leaderboards.get(skill));
}
manager.setPowerLeaderboard(powerLeaderboard);
manager.setAverageLeaderboard(averageLeaderboard);
manager.setSorting(false);
}
Aggregations