private List <VendorRewards> FindRewardsByGem(string gem) { List <VendorRewards> vrList = new List <VendorRewards>(); foreach (var entry in _allVendorRewards) { VendorRewards vr = entry.Value; var rewardFound = vr.RewardsPerClasses.Where(x => x.Key == gem); if (rewardFound.Count() >= 1) { vrList.Add(vr); } } return(vrList); }
private void LoadVendorRewards(JObject allvendorRewards) { foreach (var child in allvendorRewards["cargoquery"]) { try { string npc = child["title"]["npc"].ToString(); //skip siosa and lilly roth if (npc == "Siosa" || npc == "Lilly Roth") { continue; } string questName = child["title"]["quest"].ToString(); string reward = child["title"]["reward"].ToString(); string act = child["title"]["act"].ToString(); string[] classes = child["title"]["classes"].ToString().Replace("�", "\\").Split('\\'); List <string> classesList = new List <string>(); classesList = classes.ToList(); if (_allVendorRewards.ContainsKey(questName)) { _allVendorRewards[questName].RewardsPerClasses.Add(reward, classesList); } else { VendorRewards vendorRewards = new VendorRewards(); vendorRewards.Name = questName; vendorRewards.RewardsPerClasses.Add(reward, classesList); vendorRewards.Act = act; vendorRewards.NPC = npc; _allVendorRewards.Add(questName, vendorRewards); } } catch { MessageBox.Show("exception"); } } }