コード例 #1
0
        public async Task GetSoloLeaderboardTest()
        {
            var leaderboardId = new SoloLeaderboardId
            {
                SeasonId    = await DiabloApi.Season.GetActiveSeasonIdAsync(),
                CharacterId = CharacterKind.Wizard,
                IsHardcore  = false
            };

            var leaderboard = await DiabloApi.Season.GetSoloLeaderboard(AuthenticationScope, leaderboardId);

            Assert.IsNotEmpty(leaderboard.Ranks);
        }
コード例 #2
0
ファイル: SeasonEndpoint.cs プロジェクト: leardev/DiabloSharp
        public async Task <SoloLeaderboard> GetSoloLeaderboard(IAuthenticationScope authenticationScope, SoloLeaderboardId leaderboardId)
        {
            var mapper          = new SoloLeaderboardMapper(leaderboardId);
            var leaderboardSlug = leaderboardId.ToSlug();
            var seasonIndex     = (int)leaderboardId.SeasonId;

            using (var client = CreateClient(authenticationScope))
            {
                var seasonLeaderboardDetail = await client.GetSeasonLeaderboardAsync(seasonIndex, leaderboardSlug);

                return(mapper.Map(seasonLeaderboardDetail));
            }
        }
コード例 #3
0
 public SoloLeaderboardMapper(SoloLeaderboardId leaderboardId)
 {
     _leaderboardId = leaderboardId;
 }