Example #1
0
 /// <summary>
 /// Check if the current player has BlackJack
 /// </summary>
 /// <returns>Returns true if the current player has BlackJack</returns>
 public bool HasBlackJack()
 {
     if (hand.GetSumOfHand() == 21)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Example #2
0
        /// <summary>
        /// This method compares two BlackJack hands
        /// </summary>
        /// <param name="otherHand"></param>
        /// <returns></returns>
        public int CompareFaceValue(object otherHand)
        {
            BlackJackHand aHand = otherHand as BlackJackHand;

            if (aHand != null)
            {
                return(this.GetSumOfHand().CompareTo(aHand.GetSumOfHand()));
            }
            else
            {
                throw new ArgumentException("Argument is not a Hand");
            }
        }