Beispiel #1
0
        override public void UnregisterCard(ICardModel card)
        {
            ValidateCards();
            if (Multiples == null)
            {
                Multiples = new List <int>();
            }
            int index = _Cards.IndexOf(card as Card);

            if (index > 0)
            {
                //we have multiples of this card, remove one
                Multiples[index]--;
            }
            else if (index == 1)
            {
                //this is the last multiple, complete remove this card
                card.UnregisterWithDeck(this);
                Multiples.RemoveAt(index);
                _Cards.Remove(card as Card);
            }
        }