private BlackjackHandSettlement settleHand(BlackjackGameRoundPlayer roundplayer, BlackjackGamePlayer realPlayer)
        {
            if (RoundInProgress.RoundPlayers.Any(a => a.HasAction))
            {
                if (!roundplayer.Hand.IsBusted)
                {
                    throw new InvalidOperationException("Non-busted hands cannot settle until round completes");
                }
            }

            var settlement = new BlackjackHandSettlement(roundplayer, RoundInProgress.DealerHand);

            if (settlement.WagerOutcome == WagerOutcome.Draw)
            {
                roundplayer.Player.Account.Credit(settlement.WagerAmount);
                realPlayer.Account.Credit(settlement.WagerAmount);
            }
            else if (settlement.WagerOutcome == WagerOutcome.Win)
            {
                roundplayer.Player.Account.Credit(settlement.WagerAmount * 2);
                realPlayer.Account.Credit(settlement.WagerAmount * 2);
            }



            RoundInProgress.SettleRoundPlayer(roundplayer, settlement);

            return(settlement);
        }
        public BlackjackHandSettlement(BlackjackGameRoundPlayer player, BlackjackHand dealerHand)
        {
            if (player == null)
            {
                throw new ArgumentNullException("player");
            }

            if (player.Hand == null)
            {
                throw new ArgumentNullException("player.hand");
            }

            if (dealerHand == null)
            {
                throw new ArgumentNullException("dealerHand");
            }

            DealerHand     = dealerHand;
            PlayerId       = player.Player.Id;
            PlayerHand     = player.Hand;
            PlayerPosition = player.Player.Position;
            WagerAmount    = player.Wager;
            WagerOutcome   = GetOutcome();
        }
 public void SettleRoundPlayer(BlackjackGameRoundPlayer roundplayer, BlackjackHandSettlement settlement)
 {
     Settlements.Add(settlement);
     RoundPlayers.Remove(roundplayer);
 }