private Deck CreateDeck(PlayerClass klass, IEnumerable <TrackedCard> cards)
        {
            Common.Log.Debug($"Tracker: CreatingDeck {klass} {cards.Count()}");
            var deck = new Deck()
            {
                Class = klass
            };
            // add the cards to the deck
            // create a temp HDT deck too, to check if its standard
            var hdtDeck = new HDTDeck();

            foreach (var card in cards)
            {
                var c = DB.GetCardFromId(card.Id);
                c.Count = card.Count;
                hdtDeck.Cards.Add(c);
                if (c != null && c != DB.UnknownCard)
                {
                    deck.Cards.Add(
                        new Card(c.Id, c.LocalizedName, c.Count, c.Background.Clone()));
                    Common.Log.Debug($"Tracker: Card {c.Id} x{c.Count}");
                }
                else
                {
                    Common.Log.Debug($"Tracker: Card {card.Id} not found");
                }
            }
            deck.IsStandard = hdtDeck.StandardViable;
            return(deck);
        }
        public void AddDeck(Deck deck)
        {
            if (deck == null)
            {
                Common.Log.Debug("Tracker: Attempting to add a null deck");
                return;
            }
            HDTDeck d = new HDTDeck()
            {
                Name  = deck.Name,
                Class = deck.Class.ToString(),
                Cards = new ObservableCollection <HDTCard>(deck.Cards.Select(c => DB.GetCardFromId(c.Id)))
            };

            Common.Log.Debug($"Tracker: Adding deck '{d.Name}' {d.Cards} ({d.Cards.Count})");

            DeckList.Instance.Decks.Add(d);
        }