public void SetPlayerCards(HearthMirror.Objects.Deck deck, List <Card> revealedCards)
        {
            var cards = deck?.Cards.Select(c => new Card {
                Id = c.Id, Count = c.Count
            });

            SetPlayerCards(cards, revealedCards);
        }
 private static bool IsValidDeck(HearthMirror.Objects.Deck deck)
 {
     if (deck.Type == BrawlDeckType)
     {
         return(false);
     }
     try
     {
         var count = deck.Cards.Sum(c => c.Count);
         return(count == 30 || count == 1 &&
                deck.Cards.First().Id == CardIds.Collectible.Neutral.WhizbangTheWonderful);
     }
     catch (OverflowException e)
     {
         // Probably bad data from memory
         Log.Error(e);
         return(false);
     }
 }
        public void ImportArenaDeck(HearthMirror.Objects.Deck deck)
        {
            var arenaDeck = new Deck {
                Class = Database.GetCardFromId(deck.Hero).PlayerClass,
                HsId  = deck.Id,
                Cards = new ObservableCollection <Card>(deck.Cards.Select(x =>
                {
                    var card   = Database.GetCardFromId(x.Id);
                    card.Count = x.Count;
                    return(card);
                })),
                LastEdited  = DateTime.Now,
                IsArenaDeck = true
            };

            arenaDeck.Name = Helper.ParseDeckNameTemplate(Config.Instance.ArenaDeckNameTemplate, arenaDeck);
            DeckList.Instance.Decks.Add(arenaDeck);
            DeckPickerList.UpdateDecks();
            SelectDeck(arenaDeck, true);
        }