IsWinner() public method

True = win; Null = tie; False = lose.
public IsWinner ( BlackjackCardListEvaluator dealer ) : bool?
dealer BlackjackCardListEvaluator
return bool?
Ejemplo n.º 1
0
        static long GetWinnings(BlackjackCardListEvaluator dealer, BlackjackCardListEvaluator cardListEvaluator, ulong bet)
        {
            long winningsOrLosings;

            switch (cardListEvaluator.IsWinner(dealer))
            {
            case true:
                winningsOrLosings = cardListEvaluator.isBlackjack ? (long)(bet * 1.5): (long)bet;
                break;

            case false:
                winningsOrLosings = (long)bet * -1L;
                break;

            default:
                winningsOrLosings = 0;
                break;
            }

            return(winningsOrLosings);
        }