public static bool IsCardPartOfStrongerHand(this List <BTCard> cards, BTCard BTCard) { if (!cards.Contains(BTCard)) { throw new ArgumentOutOfRangeException("We don't have a " + BTCard.GetCardName()); } // check if it's part of a pair, this return true for trips and quads as well. var isAtleastPair = cards.GetSameValuedCards(BTPokerHands.Double) .Any(g => g .Any(c => c.Value == BTCard.Value) ); // todo: check if it's part of a poker hand // not part of stronger hand. return(isAtleastPair); }
// Player Extensions public static string GetName(this BTCard c) { return(c.GetCardName()); }
public static string Selected(this BTCard card) { return($"✔️ {card.GetCardName()}"); }