Example #1
0
 //  Creates a player with a new hand and new balance
 public Player(int newBalance)
 {
     // Sets the player's name that is displayed in the UI.
     this.hand         = new BlackJackHand();
     this.balance      = newBalance;
     this.playerStatus = PlayerStatus.FirstTurn;
     this.isFirstTurn  = true;
 }
Example #2
0
 // This method compares two BlackJack hands
 public int CompareHandsValue(BlackJackHand otherHand)
 {
     if (otherHand != null)
     {
         return(this.GetSumOfHand().CompareTo(otherHand.GetSumOfHand()));
     }
     else
     {
         throw new ArgumentException("Argument is not a Hand");
     }
 }
Example #3
0
 // Reset the hand
 public void NewHand()
 {
     this.isFirstTurn = true;
     this.hand        = new BlackJackHand();
 }