Пример #1
0
        private static int playDealer(ref Deck deck, ref Hand dealerHand)
        {
            var policy = new DealerPolicy();
            //play dealer
            var dealerAction = policy.chooseDealerAction(dealerHand);

            while (dealerAction == 1)
            {
                dealerHand.addCards(deck.getCard());
                dealerAction = policy.chooseDealerAction(dealerHand);
            }

            return(dealerHand.getValue()); // return value of dealer hand.
        }
Пример #2
0
        private static int playDealer(ref Deck deck, ref Hand dealerHand)
        {
            var policy = new DealerPolicy();
            //play dealer
            var dealerAction = policy.chooseDealerAction(dealerHand);
            while (dealerAction == 1)
            {
                dealerHand.addCards(deck.getCard());
                dealerAction = policy.chooseDealerAction(dealerHand);
            }

            return dealerHand.getValue(); // return value of dealer hand.
        }