Beispiel #1
0
        public Deck AddDeck()
        {
            Deck deck = new Deck();

            deck.CreateNewId();
            deck.Name = $"Deck {++numDecksCreated}";
            AllKnownDecks.Add(deck);
            return(deck);
        }
Beispiel #2
0
        Deck GetParentDeck(Card card)
        {
            Deck parentDeck = AllKnownDecks.FirstOrDefault(x => x.ID == card.DeckId);

            if (parentDeck == null)
            {
                parentDeck = new Deck();
                parentDeck.CreateNewId();
                parentDeck.Name = card.DeckId;
                AllKnownDecks.Add(parentDeck);
            }
            return(parentDeck);
        }