Verschiedene Regelsätze implementieren #194

Merged
flixcoo merged 46 commits from feature/132-verschiedene-regelsaetze-implementieren into development 2026-04-24 10:31:36 +00:00
Showing only changes of commit a3ae8ef5b8 - Show all commits

View File

@@ -55,7 +55,16 @@ class Match {
),
group = null,
players = [],
scores = json['scores'],
scores = json['scores'] != null
? (json['scores'] as Map<String, dynamic>).map(
(key, value) => MapEntry(
key,
value != null
? ScoreEntry.fromJson(value as Map<String, dynamic>)
: null,
),
)
: {},
notes = json['notes'] ?? '';
/// Converts the Match instance to a JSON object. Related objects are
@@ -69,7 +78,7 @@ class Match {
'gameId': game.id,
'groupId': group?.id,
'playerIds': players.map((player) => player.id).toList(),
'scores': scores,
'scores': scores.map((key, value) => MapEntry(key, value?.toJson())),
'notes': notes,
};