示例#1
0
        public void PlayerPlayCard(Player player, Card card)
        {
            if (GameState != State.InProgress)
            {
                throw new InvalidOperationException($"Invalid game state {GameState.DisplayName} for PlayerPlayCard command");
            }
            var count = Deck.Hand(player).Count;

            if (Deck.Hand(player).Count < 6)
            {
                throw new InvalidOperationException($"Player {player.Name} has already played a card");
            }

            CurrentRound.PlayerPlayCard(player, card);
            if (HasAllPlayersPlayed())
            {
                GameState = State.Voting;
            }
        }