Skip to content

Commit

Permalink
Highlight winner team
Browse files Browse the repository at this point in the history
  • Loading branch information
evgfilim1 committed Apr 5, 2024
1 parent 3a56c4a commit 8a5d8f4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/widgets/player_buttons.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class _PlayerButtonsState extends OrientationDependentState<PlayerButtons> {
Widget _buildPlayerButton(BuildContext context, int playerNumber, BaseGameState gameState) {
final controller = context.watch<GameController>();
final isActive = switch (gameState) {
GameStatePrepare() || GameStateNightRest() || GameStateFinish() => false,
GameStatePrepare() || GameStateNightRest() => false,
GameStateWithPlayer(currentPlayerNumber: final p) ||
GameStateSpeaking(currentPlayerNumber: final p) ||
GameStateWithIterablePlayers(currentPlayerNumber: final p) ||
Expand All @@ -75,6 +75,8 @@ class _PlayerButtonsState extends OrientationDependentState<PlayerButtons> {
ps.contains(playerNumber),
GameStateNightKill() =>
controller.getPlayerByNumber(playerNumber).role.team == RoleTeam.mafia,
GameStateFinish(:final winner) =>
controller.getPlayerByNumber(playerNumber).role.team == winner,
};
final isSelected = switch (gameState) {
GameStateSpeaking(accusations: final accusations) => accusations.containsValue(playerNumber),
Expand Down

0 comments on commit 8a5d8f4

Please sign in to comment.