// 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; }
// 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"); } }
// Reset the hand public void NewHand() { this.isFirstTurn = true; this.hand = new BlackJackHand(); }