Updated function and limited name length to 12

This commit is contained in:
2025-06-29 01:55:45 +02:00
parent defebe64c0
commit 9cf4a6947a
3 changed files with 7 additions and 4 deletions

View File

@@ -73,11 +73,14 @@ class GameSession extends ChangeNotifier {
(json['roundList'] as List).map((e) => Round.fromJson(e)).toList();
/// Returns the length of all player names combined.
int getLengthOfPlayerNames() {
int getMaxLengthOfPlayerNames() {
int length = 0;
for (String player in players) {
length += player.length;
if (player.length >= length) {
length = player.length;
}
}
print('Maximale Länge der Spielernamen: $length');
return length;
}