This commit is contained in:
1 parent
1a1a0e373f
commit
abab72cc02
2 files changed
+12
-22
No files matched your search
@@ -1,17 +0,0 @@
|
|||||||
package nl.connectedit.swiss.domain;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class TournamentDivision {
|
|
||||||
|
|
||||||
private Long tournamentId;
|
|
||||||
|
|
||||||
private boolean divided;
|
|
||||||
|
|
||||||
private List<EventDivision> eventDivisions = new ArrayList<>();
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -223,12 +223,19 @@ public class TournamentPlayService {
|
|||||||
public Tournament updateCounter(Tournament tournament, Long matchId, Long counter) {
|
public Tournament updateCounter(Tournament tournament, Long matchId, Long counter) {
|
||||||
var match = getMatch(tournament, matchId);
|
var match = getMatch(tournament, matchId);
|
||||||
|
|
||||||
var currentlyCountingPlayer = getTournamentPlayer(tournament, match.getCounter().getId());
|
var matchCounter = match.getCounter();
|
||||||
currentlyCountingPlayer.setCounting(false);
|
if (matchCounter != null) {
|
||||||
|
var currentlyCountingPlayer = getTournamentPlayer(tournament, match.getCounter().getId());
|
||||||
|
currentlyCountingPlayer.setCounting(false);
|
||||||
|
}
|
||||||
|
|
||||||
var newCountingPlayer = getTournamentPlayer(tournament, counter);
|
if (counter == 999999) {UU
|
||||||
newCountingPlayer.setCounting(true);
|
match.setCounter(null);
|
||||||
match.setCounter(newCountingPlayer.getPlayer());
|
} else {
|
||||||
|
var newCountingPlayer = getTournamentPlayer(tournament, counter);
|
||||||
|
newCountingPlayer.setCounting(true);
|
||||||
|
match.setCounter(newCountingPlayer.getPlayer());
|
||||||
|
}
|
||||||
|
|
||||||
tournamentRepository.save(tournament);
|
tournamentRepository.save(tournament);
|
||||||
return tournament;
|
return tournament;
|
||||||
|
|||||||
Reference in new issue
Block a user