예제 #1
0
        private void Create_Click(object sender, RoutedEventArgs e)
        {
            List<Card> cards = _selectedCards.Select(x =>
            {
                var cardInfo = Library.GetCardInfo(x.Name);
                return new Card(cardInfo.Item1, cardInfo.Item2, x.Count);
            }).ToList();

            Deck deck = new Deck(this.deckName.Text, cards);

            _callback(deck);
            this.Close();
        }
예제 #2
0
        private void InitializeDeck(string deckName)
        {
            // Clone instead so we don't have to reset state?
            if (currentDeck != null) currentDeck.Reset();

            currentDeck = deckCollection.GetDeck(deckName);
            this.Dispatcher.Invoke((Action)(() =>
            {
                this.cardCollection.ItemsSource = currentDeck.Cards;
                this.deckControl.ItemsSource = new List<Deck> { currentDeck };
            }));
        }
예제 #3
0
 public void AddDeck(Deck deck)
 {
     _collection[deck.Name] = deck;
 }