Exemplo n.º 1
0
 public void AddCardToHand(Card card)
 {
     if (card != null)
     {
         Cards.Add(card);
         if (Cards.Count() >= 2)
         {
             Hand = new BlackjackHand(Cards);
         }
     }
 }
        public void AddCardToDealerHand(Card card)
        {
            if (card != null)
            {
                DealerCards.Add(card);
                if (DealerCards.Count() >= 2)
                {
                    DealerHand = new BlackjackHand(DealerCards);

                    if (DealerHand.IsBlackjack || DealerHand.Score == 21)
                    {
                        DealerHas21 = true;
                    }
                }
            }
        }
        public BlackjackHandSettlement(BlackjackGameRoundPlayer player, BlackjackHand dealerHand)
        {
            if (player == null)
            {
                throw new ArgumentNullException("player");
            }

            if (player.Hand == null)
            {
                throw new ArgumentNullException("player.hand");
            }

            if (dealerHand == null)
            {
                throw new ArgumentNullException("dealerHand");
            }

            DealerHand     = dealerHand;
            PlayerId       = player.Player.Id;
            PlayerHand     = player.Hand;
            PlayerPosition = player.Player.Position;
            WagerAmount    = player.Wager;
            WagerOutcome   = GetOutcome();
        }