Aktualisiert die Punktevergabe in TournamentService.js und TournamentsView.vue, sodass der Sieger +1 Punkt erhält und der Verlierer -1 Punkt. Fügt eine neue Methode getLivePosition hinzu, um die Live-Punkte und -Sätze der Spieler in der Gruppe zu berechnen und anzuzeigen. Optimiert die Darstellung der Platzierung in der Tabelle.

This commit is contained in:
Torsten Schulz (local)
2025-09-21 17:25:23 +02:00
parent 561d8186d3
commit 66046ddccd
2 changed files with 94 additions and 8 deletions

View File

@@ -380,8 +380,13 @@ class TournamentService {
for (const m of groupMatches.filter(m => m.groupId === g.id)) {
if (!stats[m.player1Id] || !stats[m.player2Id]) continue;
const [p1, p2] = m.result.split(":").map(n => parseInt(n, 10));
if (p1 > p2) stats[m.player1Id].points += 2;
else stats[m.player2Id].points += 2;
if (p1 > p2) {
stats[m.player1Id].points += 1; // Sieger bekommt +1
stats[m.player2Id].points -= 1; // Verlierer bekommt -1
} else {
stats[m.player2Id].points += 1; // Sieger bekommt +1
stats[m.player1Id].points -= 1; // Verlierer bekommt -1
}
stats[m.player1Id].setsWon += p1;
stats[m.player1Id].setsLost += p2;
stats[m.player2Id].setsWon += p2;