//Looks at banned characters and manipulates them private void workOnBans(Dictionary<uint, Champion> champions, JToken bans, Games newGame) { if (bans != null) { foreach (var ban in bans) { uint ID = (uint)ban["championId"]; if (champions.ContainsKey(ID)) { champions[ID].banCount++; } else { Champion dchamp = new Champion(); dchamp.ID = ID; dchamp.banCount++; newGame.championsBanned.Add(dchamp); } } } }
//Adds new champion to the Champions dictionary private Champion addNewChampion(uint ID, JToken item) { Champion Champ = new Champion(); Champ.itemStats = new Dictionary<uint, Items>(); Champ.ID = ID; Champ.totalDeaths += (uint)item["stats"]["deaths"]; Champ.totalKills += (uint)item["stats"]["kills"]; Champ.lanePrefCount = new Dictionary<Champion.Lanes, int>(); for (int i = 0, max = 6; i < max; i++) { Items Item = new Items(); Item.ID = (uint)item["stats"]["item" + i]; if (Champ.itemStats.ContainsKey(Item.ID)) { Champ.itemStats[Item.ID].numberOfTimesUsed++; } else { Item.numberOfTimesUsed++; Champ.itemStats.Add(Item.ID, Item); } } switch ((string)item["timeline"]["lane"]) { case "TOP": { Champ.lanePrefCount.Add(Champion.Lanes.TOP, 0); } break; case "JUNGLE": { Champ.lanePrefCount.Add(Champion.Lanes.JUNGLE, 0); } break; case "BOTTOM": { Champ.lanePrefCount.Add(Champion.Lanes.BOTTOM, 0); } break; case "MIDDLE": { Champ.lanePrefCount.Add(Champion.Lanes.MIDDLE, 0); } break; } Champ.gameCount++; return Champ; }