Add() public method

public Add ( Card card ) : void
card Card
return void
        private CardSet GetSeenCards(Game game, bool showdown)
        {
            CardSet seen_cards = new CardSet();

            if (showdown)
            {
                foreach (Card card in game.DealerHand)
                {
                    seen_cards.Add(card);
                }
            }
            else
            {
                seen_cards.Add(game.DealerHand[0]);
            }

            foreach (Hand hand in game.PlayerHandSet)
            {
                if (hand.IsSplit()) continue;

                foreach (Card card in hand)
                {
                    seen_cards.Add(card);
                }
            }

            return seen_cards;
        }
        private CardSet GetSeenCards(Game game, bool showdown)
        {
            CardSet seen_cards = new CardSet();

            if (showdown)
            {
                foreach (Card card in game.DealerHand)
                {
                    seen_cards.Add(card);
                }
            }
            else
            {
                seen_cards.Add(game.DealerHand[0]);
            }

            foreach (Hand hand in game.PlayerHandSet)
            {
                if (hand.IsSplit())
                {
                    continue;
                }

                foreach (Card card in hand)
                {
                    seen_cards.Add(card);
                }
            }

            return(seen_cards);
        }
Example #3
0
        public static CardSet operator +(CardSet set1, CardSet set2)
        {
            CardSet tmp = new CardSet(set1);
            tmp.Add(set2);

            return tmp;
        }
Example #4
0
        public static CardSet operator +(CardSet set1, CardSet set2)
        {
            CardSet tmp = new CardSet(set1);

            tmp.Add(set2);

            return(tmp);
        }
Example #5
0
        public object Clone()
        {
            CardSet cloned_set = new CardSet();

            foreach (Card card in this.card_set)
            {
                cloned_set.Add((Card)(card.Clone()));
            }

            return(cloned_set);
        }
Example #6
0
        public void ResetShoe()
        {
            shoe.Clear();

            int decks = rules.Decks;

            for (int i = 0; i < decks; i++)
            {
                shoe.Add(CardsFactory.StandardDeck);
            }

            shoe.Shuffle(random);

            agent.ResetShoe(this);
        }
Example #7
0
        public CardSet ExtractTop(int count)
        {
            CardSet set = new CardSet();

            for (int i = 0; i < count; i++)
            {
                if (card_set.Count == 0)
                {
                    break;
                }

                set.Add(ExtractTop());
            }

            return(set);
        }
Example #8
0
        public CardSet ExtractRandom(Random rand, int count)
        {
            CardSet set = new CardSet();

            for (int i = 0; i < count; i++)
            {
                if (card_set.Count == 0)
                {
                    break;
                }

                int card_index = rand.Next(card_set.Count);
                set.Add((Card)card_set[card_index]);
                RemoveCount(card_set[i]);
                card_set.RemoveAt(card_index);
            }

            return(set);
        }
Example #9
0
 public void Hit(Card card)
 {
     cards.Add(card);
     hit_count++;
 }
Example #10
0
        public CardSet ExtractTop(int count)
        {
            CardSet set = new CardSet();

            for (int i = 0; i < count; i++)
            {
                if (card_set.Count == 0)
                    break;

                set.Add(ExtractTop());
            }

            return set;
        }
Example #11
0
        public CardSet ExtractRandom(Random rand, int count)
        {
            CardSet set = new CardSet();

            for (int i = 0; i < count; i++)
            {
                if (card_set.Count == 0)
                    break;

                int card_index = rand.Next(card_set.Count);
                set.Add((Card)card_set[card_index]);
                RemoveCount(card_set[i]);
                card_set.RemoveAt(card_index);
            }

            return set;
        }
Example #12
0
        public object Clone()
        {
            CardSet cloned_set = new CardSet();

            foreach (Card card in this.card_set)
                cloned_set.Add((Card)(card.Clone()));

            return cloned_set;
        }