public bool PlayHand(BlackJackHand hand) { while (hand.Score() < HIT_UNTIL) { BlackJackCard card = deck.DealCard(); if (card == null) { return(false); } hand.AddCard(card); } return(true); }
public List <int> GetWinners() { List <int> winners = new List <int>(); int winningScore = 0; for (int i = 0; i < hands.Length; i++) { BlackJackHand hand = hands[i]; if (!hand.Busted()) { if (hand.Score() > winningScore) { winningScore = hand.Score(); winners.Clear(); winners.Add(i); } else if (hand.Score() == winningScore) { winners.Add(i); } } } return(winners); }