コード例 #1
0
ファイル: RiotApi.cs プロジェクト: AnasMostefaoui/RiotSharp
 /// <summary>
 /// Gets the current game by summoner ID asynchronously.
 /// </summary>
 /// <param name="region">Region where to retrieve the data.</param>
 /// <param name="summonerId">ID of the summoner for which to retrieve current game.</param>
 /// <returns>Current game of the summoner.</returns>
 public async Task<CurrentGame> GetCurrentGameAsync(Platform platform, long summonerId)
 {
     var json = await requester.CreateRequestAsync(
         string.Format(CurrentGameRootUrl, platform.ToString()) + string.Format(IdUrl, summonerId),
         platform.ConvertToRegion());
     return (await Task.Factory.StartNew(() => JsonConvert.DeserializeObject<CurrentGame>(json)));
 }
コード例 #2
0
ファイル: RiotApi.cs プロジェクト: AnasMostefaoui/RiotSharp
 /// <summary>
 /// Gets the current game by summoner ID synchronously.
 /// </summary>
 /// <param name="platform">Region where to retrieve the data.</param>
 /// <param name="summonerId">ID of the summoner for which to retrieve current game.</param>
 /// <returns>Current game of the summoner.</returns>
 public CurrentGame GetCurrentGame(Platform platform, long summonerId)
 {
     var json = requester.CreateRequest(
         string.Format(CurrentGameRootUrl, platform.ToString()) + string.Format(IdUrl, summonerId),
         platform.ConvertToRegion());
     return JsonConvert.DeserializeObject<CurrentGame>(json);
 }