public static IReadOnlyList <IDeck> ReadTemplateDecks(HearthstoneImage image)
        {
            var templates = image["GameDbf"]["DeckTemplate"]["m_records"]["_items"];
            var result    = new List <IDeck>();

            for (var i = 0; i < templates.Length; i++)
            {
                if (templates[i] != null)
                {
                    var     template = templates[i];
                    var     deckId   = template["m_deckId"];
                    DbfDeck dbfDeck  = ActiveDeckReader.GetDbfDeck(image, deckId);
                    if (dbfDeck == null)
                    {
                        continue;
                    }

                    IList <int> decklist = ActiveDeckReader.BuildDecklistFromTopCard(image, dbfDeck.TopCardId);
                    result.Add(new Deck()
                    {
                        DeckId    = deckId,
                        Id        = template["m_ID"],
                        DeckList  = decklist.Select(dbfId => "" + dbfId).ToList(),
                        Name      = dbfDeck.Name,
                        HeroClass = template["m_classId"],
                    });
                }
            }
            return(result);
        }
        public static IList <int> GetTemplateDeck(HearthstoneImage image, int selectedDeck)
        {
            var dbf          = image["GameDbf"];
            var starterDecks = dbf["Deck"]["m_records"]["_items"];
            var decklist     = new List <int>();

            for (var i = 0; i < starterDecks.Length; i++)
            {
                if (starterDecks[i] != null)
                {
                    var deckId = starterDecks[i]["m_ID"];
                    if (deckId == selectedDeck)
                    {
                        var topCardId = starterDecks[i]["m_topCardId"];
                        decklist.AddRange(ActiveDeckReader.BuildDecklistFromTopCard(image, topCardId));
                    }
                }
            }
            return(decklist);
        }