コード例 #1
0
        public virtual void StartRound()
        {
            RoundClosedBecauseOfDealer21 = false;
            if (IsRoundInProgress)
            {
                throw new InvalidOperationException("Live round in progress");
            }

            if (!RoundPlayersQueuedForNextRound.Any())
            {
                throw new InvalidOperationException("No players have wagered");
            }

            var roundInProgress = new BlackjackGameRound(RoundPlayersQueuedForNextRound);

            RoundPlayersQueuedForNextRound.Clear();

            Dealer.Deal(roundInProgress);

            if (DealerHas21)
            {
                EndRound();
                RoundClosedBecauseOfDealer21 = true;
            }
        }