Ejemplo n.º 1
0
 /// <summary>
 /// Sets up the AI for the Dealer during the game of BlackJack.
 /// </summary>
 /// <param name="bJ"></param>
 /// <param name="dealer"></param>
 /// <param name="deck"></param>
 public void DealerAI()
 {
     while (PlayersPoints > DealersPoints && DealersPoints <= 21)
     {
         DealersCards.Add(Dealer.Hit(Deck));
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Starts a new game of BlackJack by reseting all previous values.
 /// </summary>
 public void NewGame()
 {
     Deck = new Deck();
     DealersCards.Clear();
     DealersPoints = 0;
     PlayersCards.Clear();
     PlayersPoints = 0;
     GameBalance   = 0;
     GameMinWager  = 0;
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Sets up the game of BlackJack with a card shuffle and distribution to
        /// active players
        /// </summary>
        public void SetUpGame()
        {
            // Dealer shuffles the deck of cards.
            Dealer.Shuffle(Deck);

            // Dealer hits 4 cards from the deck.
            for (int i = 0; i < 4; i++)
            {
                if (i < 2)
                {
                    PlayersCards.Add(Dealer.Hit(Deck));
                }
                else
                {
                    DealersCards.Add(Dealer.Hit(Deck));
                }
            }
        }