Esempio n. 1
0
        public Deck Deal(HandCollection hands, Seat dealer)
        {
            var seat = dealer;

            foreach (var hand in hands)
            {
                hand.Cards.Clear();
            }
            for (int i = 0; i < Cards.Length; ++i)
            {
                seat = HandCollection.NextSeat(seat);
                hands[seat].Add(Cards[i]);
            }

            return(this);
        }
Esempio n. 2
0
        public Deck Deal(HandCollection hands, Seat dealer, params Hand[] fixedHands)
        {
            var seat = dealer;

            foreach (var hand in hands)
            {
                if (!fixedHands.Contains <Hand>(hand))
                {
                    hand.Cards.Clear();
                }
            }
            for (int i = 0; i < Cards.Length; ++i)
            {
                seat = HandCollection.NextSeat(seat);
                if (fixedHands.Contains <Hand>(hands[seat]))
                {
                    continue;
                }
                var  card      = Cards[i];
                bool fixedCard = false;
                foreach (var fixedHand in fixedHands)
                {
                    if (fixedHand.Cards.Contains(card))
                    {
                        fixedCard = true;
                        break;
                    }
                }
                if (!fixedCard)
                {
                    hands[seat].Add(Cards[i]);
                }
            }

            return(this);
        }