public void Payout(BlackjackPlayer player) { BlackjackHand dealerHand = this.Hand; BlackjackHand playerHand = this.Hand; decimal winnings = 0; if (playerHand.Busted) { winnings = 0; } else if (playerHand.Blackjack) { winnings = playerHand.Bet * 2.5m; } else if (dealerHand.GetValue() == playerHand.GetValue()) { winnings = playerHand.Bet; } else if (dealerHand.Busted || dealerHand.GetValue() < playerHand.GetValue()) { winnings = playerHand.Bet * 2m; } player.User.Bankroll += winnings; }
public void AddPlayer(BlackjackPlayer player) { player.JoinGame(this); this.Player = player; }