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