Commit 12535fdc authored by Torge Hamann's avatar Torge Hamann 💡

Add specific group ordering for TFT-Stages

parent 1bd1546f
Pipeline #161728671 failed with stages
in 59 seconds
......@@ -2,12 +2,10 @@ package de.fearnixx.jeak.tournament.entities.stage;
import de.fearnixx.jeak.tournament.entities.team.Team;
import de.fearnixx.jeak.tournament.entities.tournament.TournamentParameter;
import de.fearnixx.jeak.tournament.enums.StageType;
import javax.persistence.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
......@@ -103,6 +101,12 @@ public class Group {
}
private void sortMemberships(ArrayList<GroupMembership> groupMembers) {
//TFT-Group-ordering is different than all other stage-types. Only rounds won are counted.
if (getStage().getType().equals(StageType.TFT)) {
groupMembers.sort(Comparator.comparingInt(GroupMembership::getRoundsWon).reversed());
return;
}
groupMembers.sort(
(a, b) -> {
int compA = a.getPoints();
......
......@@ -4,8 +4,6 @@ import de.fearnixx.jeak.tournament.entities.team.Team;
import de.fearnixx.jeak.tournament.entities.tournament.TournamentParticipation;
import javax.persistence.*;
import java.util.ArrayList;
import java.util.Optional;
@Entity(name = "GroupMembership")
@Table(name = "GROUP_MEMBERSHIP")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment