fix: some problems are fixed

This commit is contained in:
2026-07-05 18:40:53 +03:30
parent 5017e9a613
commit e94f03c499
16 changed files with 384 additions and 152 deletions
@@ -6,9 +6,13 @@ import '../../domain/entities/game_entities.dart';
/// یک بازیکن در اتاق انتظارِ میز خصوصی.
class LobbyPlayer {
final String name;
final String avatar; // seed آواتارِ انتخابیِ کاربر
final bool host;
final int seat; // جایگاهِ مطلق (۰..۳)
const LobbyPlayer(this.name, this.host, this.seat);
const LobbyPlayer(this.name, this.avatar, this.host, this.seat);
/// seedِ آواتار برای نمایش: آواتارِ انتخابی، وگرنه نام.
String get avatarSeed => avatar.isNotEmpty ? avatar : name;
}
/// وضعیت اتاق انتظارِ میز خصوصی (دورهمی).
@@ -35,6 +39,7 @@ class TableLobby {
players: ((j['players'] as List?) ?? [])
.map((e) => LobbyPlayer(
(e['name'] ?? '') as String,
(e['avatar'] ?? '') as String,
(e['host'] ?? false) as bool,
(e['seat'] ?? 0) as int,
))