fix: some buggs
This commit is contained in:
@@ -37,6 +37,7 @@ class GameState {
|
||||
final List<int> tricksWon;
|
||||
final List<int> scores;
|
||||
final int targetScore;
|
||||
final int turnTimeoutMs; // مهلتِ نوبتِ انسان (برای شمارندهی نوبت)
|
||||
final List<GamePlayer> players;
|
||||
|
||||
GameState({
|
||||
@@ -54,6 +55,7 @@ class GameState {
|
||||
required this.tricksWon,
|
||||
required this.scores,
|
||||
required this.targetScore,
|
||||
required this.turnTimeoutMs,
|
||||
required this.players,
|
||||
});
|
||||
|
||||
@@ -78,6 +80,7 @@ class GameState {
|
||||
tricksWon: ints(j['tricks_won']),
|
||||
scores: ints(j['scores']),
|
||||
targetScore: (j['target_score'] ?? 7) as int,
|
||||
turnTimeoutMs: (j['turn_timeout_ms'] ?? 0) as int,
|
||||
players: ((j['players'] as List?) ?? [])
|
||||
.map((e) => GamePlayer.fromJson(Map<String, dynamic>.from(e as Map)))
|
||||
.toList(),
|
||||
|
||||
Reference in New Issue
Block a user