Example #1
0
        public DeckCardData Clone()
        {
            DeckCardData deckCardData = new DeckCardData
            {
                CardName = CardName,
                Amount   = Amount
            };

            return(deckCardData);
        }
Example #2
0
        public void AddCard(string cardId)
        {
            bool wasAdded = false;

            foreach (DeckCardData card in Cards)
            {
                if (card.CardName == cardId)
                {
                    card.Amount++;
                    wasAdded = true;
                }
            }

            if (!wasAdded)
            {
                DeckCardData cardData = new DeckCardData();
                cardData.CardName = cardId;
                cardData.Amount   = 1;
                Cards.Add(cardData);
            }
        }