feat: add coin private table

This commit is contained in:
2026-07-04 12:45:52 +03:30
parent 7acd72c286
commit c2356b3242
4 changed files with 75 additions and 7 deletions
@@ -19,6 +19,7 @@ class TableLobby {
final int youSeat; // جایگاهِ مطلقِ خودِ کاربر (برای چیدمانِ صحنه)
final int remaining;
final bool unlimited;
final int stake; // شرطِ سکه‌ایِ هر بازیکن (۰ یعنی رایگان)
const TableLobby({
required this.code,
required this.players,
@@ -26,6 +27,7 @@ class TableLobby {
required this.youSeat,
required this.remaining,
required this.unlimited,
required this.stake,
});
factory TableLobby.fromJson(Map<String, dynamic> j) => TableLobby(
@@ -41,9 +43,10 @@ class TableLobby {
youSeat: (j['you_seat'] ?? 0) as int,
remaining: (j['remaining'] ?? 0) as int,
unlimited: (j['unlimited'] ?? false) as bool,
stake: (j['stake'] ?? 0) as int,
);
String get sig => '$code|$isHost|$youSeat|$remaining|$unlimited|'
String get sig => '$code|$isHost|$youSeat|$remaining|$unlimited|$stake|'
'${players.map((p) => '${p.name}${p.host ? '*' : ''}@${p.seat}').join(',')}';
}