fixed tournament random order at the end
This commit is contained in:
@@ -54,18 +54,18 @@ public class Tournament {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<Set<Player>> getPlaces() {
|
public List<Set<Player>> getPlaces() {
|
||||||
List<Set<Player>> players = new ArrayList<>(
|
Map<Integer, Set<Player>> players = this.getGameScores().entrySet().stream()
|
||||||
this.getGameScores().entrySet().stream()
|
.collect(
|
||||||
.collect(
|
Collectors.groupingBy(
|
||||||
Collectors.groupingBy(
|
Map.Entry::getValue,
|
||||||
Map.Entry::getValue,
|
Collectors.mapping(Map.Entry::getKey, Collectors.toSet())
|
||||||
Collectors.mapping(Map.Entry::getKey, Collectors.toSet())
|
)
|
||||||
)
|
);
|
||||||
).values()
|
|
||||||
);
|
|
||||||
|
|
||||||
Collections.reverse(players);
|
return players.entrySet().stream()
|
||||||
return players;
|
.sorted(Map.Entry.<Integer, Set<Player>>comparingByKey().reversed())
|
||||||
|
.map(Map.Entry::getValue)
|
||||||
|
.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
private int boost(int selfPlace, int placeCount) {
|
private int boost(int selfPlace, int placeCount) {
|
||||||
|
|||||||
Reference in New Issue
Block a user