private async Task <string> GetMythicPlus(string character, string realm) // Returns a string to this.ArmoryLookup() { MPlusSummaryJson summary = await this.Call($"https://{this.Config.Region}.api.blizzard.com/profile/wow/character/{realm}/{character}/mythic-keystone-profile", Namespace.Profile, typeof(MPlusSummaryJson)); bool hasCurrentSeason = false; if (summary.Seasons is not null) { foreach (var season in summary.Seasons) { if (season.Id == this.MplusSeasonID) { hasCurrentSeason = true; break; } } } if (hasCurrentSeason) { MythicPlusData data = new MythicPlusData(); MPlusSeasonInfoJson mplusseasoninfo = await this.Call($"https://{this.Config.Region}.api.blizzard.com/profile/wow/character/{realm}/{character}/mythic-keystone-profile/season/{this.MplusSeasonID}", Namespace.Profile, typeof(MPlusSeasonInfoJson)); data.Parse(summary, mplusseasoninfo); return(data.ToString()); } else { return("None"); } }
public void Parse(MPlusSummaryJson summary, MPlusSeasonInfoJson season) { if (summary.CurrentMythicRating is not null) { this.Rating = (int)summary.CurrentMythicRating.Rating; } foreach (BestRun run in season.BestRuns) { if (run.KeystoneLevel > this.HighestRun) { this.HighestRun = (int)run.KeystoneLevel; } } }