Translated and added comments and prints
This commit is contained in:
@@ -100,12 +100,12 @@ class _ActiveGameViewState extends State<ActiveGameView> {
|
||||
);
|
||||
}
|
||||
|
||||
/// Returns a list of player indices sorted by their scores in
|
||||
/// ascending order.
|
||||
List<int> _getSortedPlayerIndices() {
|
||||
// Erstelle eine Liste von Indizes der Spieler
|
||||
List<int> playerIndices =
|
||||
List<int>.generate(widget.gameSession.players.length, (index) => index);
|
||||
// Sortiere die Indizes basierend auf den summierten Punkten
|
||||
// (playerScores[i][0])
|
||||
// Sort the indices based on the summed points
|
||||
playerIndices.sort((a, b) {
|
||||
int scoreA = widget.gameSession.playerScores[a][0];
|
||||
int scoreB = widget.gameSession.playerScores[b][0];
|
||||
@@ -114,6 +114,9 @@ class _ActiveGameViewState extends State<ActiveGameView> {
|
||||
return playerIndices;
|
||||
}
|
||||
|
||||
/// Returns a widget that displays the placement prefix based on the index.
|
||||
/// First three places are represented by medals, and the rest are numbered.
|
||||
/// [index] is the index of the player in the descending sorted list.
|
||||
Widget _getPlacementPrefix(int index) {
|
||||
switch (index) {
|
||||
case 0:
|
||||
|
||||
@@ -40,12 +40,11 @@ class _RoundViewState extends State<RoundView> {
|
||||
@override
|
||||
void initState() {
|
||||
print('Runde ${widget.roundNumber} geöffnet');
|
||||
print('Abgeschlossene Runden: '
|
||||
'${widget.gameSession.playerScores[0].length - 1}');
|
||||
print('Aktuelle Runde: ${widget.gameSession.round}');
|
||||
print('Neuste Runde: ${widget.gameSession.playerScores[0].length}');
|
||||
if (widget.gameSession.round < widget.gameSession.playerScores[0].length) {
|
||||
print('Die Länge ist ${widget.gameSession.playerScores[0].length} und '
|
||||
'somit kleiner als die Runde ${widget.gameSession.round}');
|
||||
print('Die Runde ${widget.gameSession.round} ist kleiner als die neuste '
|
||||
'Runde ${widget.gameSession.playerScores[0].length}, somit werden '
|
||||
'die bereits eingetragenen Punkte angezeigt.');
|
||||
|
||||
// If the current round has already been played, the text fields
|
||||
// are filled with the scores from this round
|
||||
|
||||
Reference in New Issue
Block a user