public static List <OrderedCardSet> GetCombinationOfPokerHands(OrderedCardSet handCards, OrderedCardSet community)
        {
            List <PlayingCard> totalCards = new List <PlayingCard>();

            totalCards.AddRange(handCards.asList());
            totalCards.AddRange(community.asList());

            List <OrderedCardSet> possibleSets = new List <OrderedCardSet>();
            int len = totalCards.Count;


            for (int t1 = 0; t1 < len; t1 += 1)
            {
                for (int t2 = t1 + 1; t2 < len; t2 += 1)
                {
                    for (int t3 = t2 + 1; t3 < len; t3 += 1)
                    {
                        for (int t4 = t3 + 1; t4 < len; t4 += 1)
                        {
                            for (int t5 = t4 + 1; t5 < len; t5 += 1)
                            {
                                OrderedCardSet set = new OrderedCardSet(new List <PlayingCard> {
                                    totalCards[t1], totalCards[t2], totalCards[t3], totalCards[t4], totalCards[t5]
                                });
                                possibleSets.Add(set);
                            }
                        }
                    }
                }
            }

            return(possibleSets);
        }
        public void ShuffleAndDealDeck(PokerPlayer playerOne, PokerPlayer playerTwo)
        {
            Random             random = new Random();
            List <PlayingCard> cards  = new List <PlayingCard>(fullDeck.asList());

            //Player one
            List <PlayingCard> oneCards = new List <PlayingCard>();

            oneCards.Add(randomRemove(cards, random));
            oneCards.Add(randomRemove(cards, random));
            playerOne.HandCards = new OrderedCardSet(oneCards);

            //Player two
            List <PlayingCard> twoCards = new List <PlayingCard>();

            twoCards.Add(randomRemove(cards, random));
            twoCards.Add(randomRemove(cards, random));
            playerTwo.HandCards = new OrderedCardSet(twoCards);

            //Community Cards
            List <PlayingCard> comCards = new List <PlayingCard>();

            comCards.Add(randomRemove(cards, random));
            comCards.Add(randomRemove(cards, random));
            comCards.Add(randomRemove(cards, random));
            comCards.Add(randomRemove(cards, random));
            comCards.Add(randomRemove(cards, random));
            communityCards = new OrderedCardSet(comCards);

            leftOverDeck = new OrderedCardSet(cards);
        }
        public static List <OrderedCardSet> GetOpponentCombinationOfHandCards(OrderedCardSet fullDeck, OrderedCardSet playerCards, OrderedCardSet communityCards)
        {
            List <PlayingCard> remaining = new List <PlayingCard>(fullDeck.asList());

            remaining.RemoveAll(card => playerCards.asList().Contains(card));
            remaining.RemoveAll(card => communityCards.asList().Contains(card));
            return(GetOpponentCombinationOfHandCards(new OrderedCardSet(remaining)));
        }
        public static OrderedCardSet GetOtherCards(OrderedCardSet fullDeck, OrderedCardSet playerCards, OrderedCardSet communityCards)
        {
            List <PlayingCard> remaining = new List <PlayingCard>(fullDeck.asList());

            remaining.RemoveAll(card => playerCards.asList().Contains(card));
            remaining.RemoveAll(card => communityCards.asList().Contains(card));

            return(new OrderedCardSet(remaining));
        }
        public static List <OrderedCardSet> GetOpponentCombinationOfHandCards(OrderedCardSet otherCards)
        {
            IList <PlayingCard>   hand    = otherCards.asList();
            List <OrderedCardSet> results = new List <OrderedCardSet>();

            for (int prim = 0; prim < hand.Count; prim += 1)
            {
                for (int sec = prim + 1; sec < hand.Count; sec += 1)
                {
                    PlayingCard    primCard   = hand[prim];
                    PlayingCard    secondCard = hand[sec];
                    OrderedCardSet cardSet    = new OrderedCardSet(new List <PlayingCard> {
                        primCard, secondCard
                    });
                    results.Add(cardSet);
                }
            }



            return(results);
        }