コード例 #1
0
 // Allow Play to hit. Dealer automatically hits when user stands.
 public void Hit()
 {
     if (BlackJackRules.CanPlayerHit(Player.Hand) && Result == GameResult.Pending)
     {
         Player.Hand.Push(MainDeck.Pop());
     }
 }
コード例 #2
0
        // When user stands, allow the Dealer to continue hitting until standlimit or bust.
        // Then go ahead and set the game result.
        public void Stand()
        {
            if (Result == GameResult.Pending)
            {
                while (BlackJackRules.CanDealerHit(Dealer.Hand, StandLimit))
                {
                    Dealer.Hand.Push(MainDeck.Pop());
                }

                Result = BlackJackRules.GetResult(Player, Dealer);
            }
        }