Пример #1
0
        //
        // Interface methods
        //

        // GainCard
        public virtual void GainCard(Card card)
        {
            // If we are not allowing duplicates, then don't let any through.
            if (!AllowDuplicates)
            {
                foreach (Card c in Cards)
                {
                    if (card.Equals(c))
                    {
                        return;
                    }
                }
            }

            // Add the card.
            addCard(card);
        }
Пример #2
0
        //
        // Interface methods
        //
        // GainCard
        public virtual void GainCard(Card card)
        {
            // If we are not allowing duplicates, then don't let any through.
            if (!AllowDuplicates)
            {
                foreach (Card c in Cards)
                {
                    if (card.Equals(c))
                    {
                        return;
                    }
                }
            }

            // Add the card.
            addCard(card);
        }