Exemplo n.º 1
0
        public void Add(Player player, Type cardMatType, IEnumerable <Card> cards)
        {
            if (!this.ContainsKey(cardMatType))
            {
                this[cardMatType] = CardMat.CreateInstance(cardMatType);
            }
            this[cardMatType].AddRange(player, cards);

            if (CardMatsChanged != null)
            {
                CardMatsChangedEventArgs pcea = new CardMatsChangedEventArgs(this[cardMatType], player, CardMatsChangedEventArgs.Operation.Added, cards);
                CardMatsChanged(this, pcea);
            }
        }
Exemplo n.º 2
0
        public CardCollection Retrieve(Player player, Type cardMatType, Predicate <Card> match, int count)
        {
            CardMat c = null;

            if (this.ContainsKey(cardMatType))
            {
                c = this[cardMatType];
            }
            else
            {
                c = CardMat.CreateInstance(cardMatType);
            }

            CardCollection cc = c.Retrieve(player, DeckPosition.Automatic, match, count);

            if (CardMatsChanged != null)
            {
                CardMatsChangedEventArgs pcea = new CardMatsChangedEventArgs(this[cardMatType], player, CardMatsChangedEventArgs.Operation.Removed, cc);
                CardMatsChanged(this, pcea);
            }

            return(cc);
        }