コード例 #1
0
    public ActionResult ChampionById(string id)
    {
        ChampionId ch = new ChampionId();

        ch.Id = id;
        return(View(ch));
    }
コード例 #2
0
 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"));
 }
コード例 #3
0
 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);
 }
コード例 #4
0
ファイル: Cache.cs プロジェクト: RiotPls/RiotPls
 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;
     }
 }
コード例 #5
0
        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.");
        }
コード例 #6
0
ファイル: Cache.cs プロジェクト: RiotPls/RiotPls
 public static bool TryGetValue(ChampionId key, [NotNullWhen(true)] out Cache <ChampionData> value)
 => _cache.TryGetValue(key, out value !);