private static IDungeonInfo BuildDungeonInfo([NotNull] HearthstoneImage image) { var savesMap = image["GameSaveDataManager"]?["s_instance"]?["m_gameSaveDataMapByKey"]; if (savesMap != null) { return(DungeonInfoReader.BuildDungeonInfo(image, DungeonKey.Duels, savesMap)); } return(null); //var deckList = new List<string>(); //if (dungeonInfo["m_dungeonCrawlDisplay"] != null // && dungeonInfo["m_dungeonCrawlDisplay"]["m_dungeonCrawlDeck"] != null // && dungeonInfo["m_dungeonCrawlDisplay"]["m_dungeonCrawlDeck"]["m_slots"] != null) //{ // var slots = dungeonInfo["m_dungeonCrawlDisplay"]["m_dungeonCrawlDeck"]["m_slots"]; // var size = slots["_size"]; // var items = slots["_items"]; // for (var i = 0; i < size; i++) // { // var card = items[i]; // var cardId = card["m_cardId"]; // var numberOfCards = 0; // var count = card["m_count"]; // var countItems = count["_items"]; // var countSize = count["_size"]; // for (int j = 0; j < countSize; j++) // { // if (countItems[j] > 0) // { // numberOfCards = countItems[j]; // } // } // for (int j = 0; j < numberOfCards; j++) // { // deckList.Add(cardId); // } // } //} }
public IDungeonInfoCollection GetDungeonInfoCollection() => DungeonInfoReader.ReadCollection(this.image);
private static IReadOnlyList <int> GetSoloDeckList(HearthstoneImage image, int missionId) { var dungeonInfo = DungeonInfoReader.ReadCollection(image); switch (missionId) { case 2663: return(dungeonInfo?[DungeonKey.DungeonRun]?.DeckList); case 2706: case 2821: return(dungeonInfo?[DungeonKey.MonsterHunt]?.DeckList); case 2890: return(dungeonInfo?[DungeonKey.RumbleRun]?.DeckList); case 3005: case 3188: case 3189: case 3190: case 3191: case 3236: return(dungeonInfo?[DungeonKey.DalaranHeist]?.DeckList); case 3328: case 3329: case 3330: case 3331: case 3332: case 3359: return(dungeonInfo?[DungeonKey.DalaranHeistHeroic]?.DeckList); case 3428: case 3429: case 3430: case 3431: case 3432: case 3438: return(dungeonInfo?[DungeonKey.TombsOfTerror]?.DeckList); case 3433: case 3434: case 3435: case 3436: case 3437: case 3439: return(dungeonInfo?[DungeonKey.TombsOfTerrorHeroic]?.DeckList); // Jaina case 3724: case 3725: case 3726: case 3727: case 3728: case 3729: case 3730: case 3731: // Rexxar case 3766: case 3767: case 3768: case 3769: case 3770: case 3771: case 3772: case 3773: // Garrosh case 3793: case 3794: case 3795: case 3796: case 3797: case 3798: case 3799: case 3800: // Uther case 3810: case 3811: case 3812: case 3813: case 3814: case 3815: case 3816: case 3817: // Anduin case 3825: case 3826: case 3827: case 3828: case 3829: case 3830: case 3831: case 3832: case 3833: // Valeera case 3851: case 3852: case 3853: case 3854: case 3855: case 3856: case 3857: case 3858: // Thrall case 3891: case 3892: case 3893: case 3894: case 3895: case 3896: case 3897: case 3898: var dungeonDetails = dungeonInfo?[DungeonKey.BookOfHeroes]; // When switching adventures, the memory info is not refreshed if (dungeonDetails == null || dungeonDetails.ScenarioId != missionId) { return(null); } return(dungeonDetails.DeckList); // Rokara case 3839: case 3840: case 3841: case 3842: case 3843: case 3844: case 3845: case 3846: // Xyrella case 3991: case 3992: case 3993: case 3994: case 3995: case 3996: case 3997: case 3998: // Guff case 4074: case 4075: case 4076: case 4077: case 4078: case 4079: case 4080: case 4081: var mercenaryDetails = dungeonInfo?[DungeonKey.BookOfMercenaries]; // When switching adventures, the memory info is not refreshed if (mercenaryDetails == null || mercenaryDetails.ScenarioId != missionId) { return(null); } return(mercenaryDetails.DeckList); } Console.WriteLine($"Unsupported scenario id: {missionId}."); return(null); }