Small adjustments bc new data class

This commit is contained in:
Felix Kirchner
2025-04-30 00:06:30 +02:00
parent 9827a983e7
commit a4f53acaf4

View File

@@ -50,7 +50,7 @@ class _ActiveGameViewState extends State<ActiveGameView> {
trailing: Row( trailing: Row(
children: [ children: [
const SizedBox(width: 5), const SizedBox(width: 5),
Text('${widget.gameSession.playerScores[playerIndex][0]} ' Text('${widget.gameSession.playerScores[playerIndex]} '
'Punkte') 'Punkte')
], ],
), ),
@@ -109,8 +109,8 @@ class _ActiveGameViewState extends State<ActiveGameView> {
List<int>.generate(widget.gameSession.players.length, (index) => index); List<int>.generate(widget.gameSession.players.length, (index) => index);
// Sort the indices based on the summed points // Sort the indices based on the summed points
playerIndices.sort((a, b) { playerIndices.sort((a, b) {
int scoreA = widget.gameSession.playerScores[a][0]; int scoreA = widget.gameSession.playerScores[a];
int scoreB = widget.gameSession.playerScores[b][0]; int scoreB = widget.gameSession.playerScores[b];
return scoreA.compareTo(scoreB); return scoreA.compareTo(scoreB);
}); });
return playerIndices; return playerIndices;