public ActionResult ChampionById(string id) { ChampionId ch = new ChampionId(); ch.Id = id; return(View(ch)); }
public override string ToString() { return(string.Format("{0} {1} {2}", StaticDataStore.Champions != null ? StaticDataStore.Champions.Champions[StaticDataStore.Champions.Keys[ChampionId]].Name : ChampionId.ToString(), Lane.ToString(), HasSmite ? "smite" : "no-smite")); }
public ActionResult ChampionById(string id) { ChampionId ch = new ChampionId(); if( !string.IsNullOrEmpty(id)) { ch.Id = id; return View(ch); } //<TODO> : handle when your id parameter is null return View(ch); }
public static void AddOrUpdate(ChampionId key, GameVersion version, Language language, ChampionData value) { if (_cache.TryGetValue(key, out var cache)) { cache[version, language] = value; } else { cache = Cache <ChampionData> .Instance; cache[version, language] = value; _cache[key] = cache; } }
private static string GetEndpoint <T>(GameVersion version, string language, ChampionId championId) { if (typeof(T) == typeof(ChampionFullData)) { return($"cdn/{version}/data/{language}/championFull.json"); } if (typeof(T) == typeof(ChampionData)) { return($"cdn/{version}/data/{language}/champion/{championId}.json"); } if (typeof(T) == typeof(SummonerSpellData)) { return($"cdn/{version}/data/{language}/summoner.json"); } if (typeof(T) == typeof(ProfileIconData)) { return($"cdn/{version}/data/{language}/profileicon.json"); } if (typeof(T) == typeof(MapData)) { return($"cdn/{version}/data/{language}/map.json"); } if (typeof(T) == typeof(MissionAssetData)) { return($"cdn/{version}/data/{language}/mission-assets.json"); } if (typeof(T) == typeof(ItemData)) { return($"cdn/{version}/data/{language}/item.json"); } throw new NotImplementedException($"Endpoint for the type {typeof(T).Name} has not been implemented."); }
public static bool TryGetValue(ChampionId key, [NotNullWhen(true)] out Cache <ChampionData> value) => _cache.TryGetValue(key, out value !);