示例#1
0
 /// <summary>
 ///  Creates a player with a new hand and new balance
 /// </summary>
 /// <param name="newBalance"></param>
 public Player(int newBalance)
 {
     // Sets the player's image and name that is displayed in the picture frame in the UI.
     //this.image = Properties.Settings.Default.PlayerImage;
     //this.name = Properties.Settings.Default.PlayerName;
     this.hand    = new BlackJackHand();
     this.balance = newBalance;
 }
示例#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");
            }
        }
示例#3
0
 /// <summary>
 /// Creates a new hand for the current player
 /// </summary>
 /// <returns>BlackJackHand</returns>
 public BlackJackHand NewHand()
 {
     this.hand = new BlackJackHand();
     return(this.hand);
 }