feat: kot and hakem kot
This commit is contained in:
@@ -93,11 +93,13 @@ class GameState {
|
||||
class HandResult {
|
||||
final int winnerTeam;
|
||||
final bool kot;
|
||||
final bool hakemKot;
|
||||
final int points;
|
||||
final List<int> scores;
|
||||
HandResult.fromJson(Map<String, dynamic> j)
|
||||
: winnerTeam = (j['winner_team'] ?? 0) as int,
|
||||
kot = (j['kot'] ?? false) as bool,
|
||||
hakemKot = (j['hakem_kot'] ?? false) as bool,
|
||||
points = (j['points'] ?? 0) as int,
|
||||
scores = ((j['scores'] as List?) ?? [])
|
||||
.map((e) => (e as num).toInt())
|
||||
|
||||
@@ -329,10 +329,11 @@ class _GameScreenState extends State<GameScreen> {
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold)),
|
||||
if (r.kot)
|
||||
const Padding(
|
||||
padding: EdgeInsets.only(top: 6),
|
||||
child: Text('کُت! (دو امتیاز)',
|
||||
style: TextStyle(color: AppColors.gold)),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 6),
|
||||
child: Text(
|
||||
r.hakemKot ? 'حاکمکُت! (${r.points} امتیاز)' : 'کُت! (${r.points} امتیاز)',
|
||||
style: const TextStyle(color: AppColors.gold)),
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
Text('امتیاز: ${r.scores.isNotEmpty ? r.scores[0] : 0} - ${r.scores.length > 1 ? r.scores[1] : 0}',
|
||||
|
||||
Reference in New Issue
Block a user