// High Card: Returns card with highest ranking card. public static Card HighCard(PlayerHand playerHand) { Card highCard = new Card(Rank.Two, Suit.Clubs); foreach (Card c in playerHand.Cards) { if (c.Rank > highCard.Rank) { highCard = c; } else { // keep current highCard } } return(highCard); }
// 5 Flush: All cards of the same suit. public static bool Flush(PlayerHand playerHand) { if (playerHand.Cards[0].Suit == playerHand.Cards[1].Suit) { Suit handSuit = playerHand.Cards[0].Suit; foreach (Card c in playerHand.Cards) { if (c.Suit != handSuit) { return(false); } else { continue; } } return(true); } else { return(false); } return(false); }
public static HandStrength evaluateHand(PlayerHand playerHand) { HandStrength strength = new HandStrength(); return(strength); }