コード例 #1
0
        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);
        }
コード例 #2
0
 // Player Extensions
 public static string GetName(this BTCard c)
 {
     return(c.GetCardName());
 }
コード例 #3
0
 public static string Selected(this BTCard card)
 {
     return($"✔️ {card.GetCardName()}");
 }