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. }
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. }