Beispiel #1
0
        public HandRank Evaluate(Hand hand)
        {
            if (hand.HasRoyalFlush())
            {
                return(HandRank.RoyalFlush);
            }
            else if (hand.HasStraightFlush())
            {
                return(HandRank.StraightFlush);
            }
            else if (hand.HasFourOfAKind())
            {
                return(HandRank.FourOfAKind);
            }
            else if (hand.HasFullHouse())
            {
                return(HandRank.FullHouse);
            }
            else if (hand.HasFlush())
            {
                return(HandRank.Flush);
            }
            else if (hand.HasStraight())
            {
                return(HandRank.Straight);
            }
            else if (hand.HasThreeOfAKind())
            {
                return(HandRank.ThreeOfAKind);
            }
            else if (hand.HasTwoPair())
            {
                return(HandRank.TwoPair);
            }
            else if (hand.HasPair())
            {
                return(HandRank.Pair);
            }

            return(HandRank.HighCard);
        }
Beispiel #2
0
 public static bool HasStraightFlush(this Hand hand) =>
 hand.HasFlush() && hand.HasStraight();