private static Tuple <string, string> GetRunesPaths(Participant participant) { var perkPrimaryStylePath = RunePaths.FirstOrDefault(rp => rp.Id == participant.Stats.PerkPrimaryStyle); var perkSubStylePath = RunePaths.FirstOrDefault(rp => rp.Id == participant.Stats.PerkSubStyle); if (perkPrimaryStylePath == null || perkSubStylePath == null) { return(Tuple.Create("https://ddragon.leagueoflegends.com/cdn/img/perk-images/Styles/Inspiration/GlacialAugment/GlacialAugment.png", "https://ddragon.leagueoflegends.com/cdn/img/perk-images/Styles/7204_Resolve.png")); } var keystonePath = ""; var found = false; foreach (var slot in perkPrimaryStylePath.Slots) { foreach (var rune in slot.Runes) { if (rune.Id == participant.Stats.Perk0) { keystonePath = rune.Icon; found = true; break; } } if (found == true) { break; } } return(Tuple.Create(keystonePath, perkSubStylePath.Icon)); }
//For the match breakdown, return the rune paths so we have access to all the runes for display on the view, selected or unselected private static List <RunePath> GetRunesOfPlayer(Participant participant) { var pathBuilder = new UrlPathBuilder(); var perkPrimaryStyle = RunePaths.FirstOrDefault(p => p.Id == participant.Stats.PerkPrimaryStyle); var perkSubStyle = RunePaths.FirstOrDefault(rp => rp.Id == participant.Stats.PerkSubStyle); var fragments = RunePaths.FirstOrDefault(rp => rp.Name == "Rune Stats"); if (perkPrimaryStyle == null || perkSubStyle == null || fragments == null) { return(null); } var runes = new List <RunePath>(); runes.Add(perkPrimaryStyle); runes.Add(perkSubStyle); runes.Add(fragments); return(runes); }