fix: some buggs

This commit is contained in:
2026-06-19 00:45:30 +03:30
parent f4d99043c4
commit a4cf2b5f39
7 changed files with 266 additions and 10 deletions
@@ -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(),