Example #1
0
        public void ResolveDealerRound(List <Player> players)
        {
            bool hasHighAce = false;

            while (ParticipantsHighestHand() < 17 && this.Bust != true)
            {
                Hit(this);
            }
            hasHighAce = HighestHandHelper.HasHighAce(Hand);
            if (hasHighAce)
            {
                while (ParticipantsHighestHand() < 18 && this.Bust != true)
                {
                    Hit(this);
                }
            }
            // As long as under the value of any of the players, then dealer keeps hitting.
            foreach (Player player in players)
            {
                while (this.ParticipantsHighestHand() < player.ParticipantsHighestHand() && this.Bust != true)
                {
                    Hit(this);
                }
            }
        }
 public int ParticipantsHighestHand()
 {
     return(HighestHandHelper.HighestPossibleHand(Hand));
 }