Пример #1
0
        //Needs testing
        #region PVP

        /// <summary>
        /// Leaderboard for 2v2, 3v3, 5v5 or RBG
        /// </summary>
        /// <param name="leaderboardOptions">choose between 2v2, 3v3, 5v5 or RBG leaderboard</param>
        /// <returns>LeaderboardRoot object</returns>
        public LeaderboardRoot GetLeaderboard(LeaderboardOptions leaderboardOptions)
        {
            var leaderboard = new LeaderboardRoot();

            var url = string.Format(@"{0}/wow/leaderboard/{1}?locale={2}&apikey={3}",
                                    _Host,
                                    LeaderboardFields.BuildOptionalQuery(leaderboardOptions),
                                    _Locale,
                                    _APIKey);

            leaderboard = json.GetDataFromURL <LeaderboardRoot>(url);

            return(leaderboard);
        }
Пример #2
0
        /// <summary>
        /// Leaderboard for 2v2, 3v3, 5v5 or RBG
        /// </summary>
        /// <param name="leaderboardOptions">choose between 2v2, 3v3, 5v5 or RBG leaderboard</param>
        /// <returns>LeaderboardRoot object</returns>
        public async Task <LeaderboardRoot> GetLeaderboardAsync(LeaderboardOptions leaderboardOptions)
        {
            var leaderboard = new LeaderboardRoot();

            var url = string.Format(
                @"{0}/wow/leaderboard/{1}?locale={2}&apikey={3}",
                _Host,
                LeaderboardFields.BuildOptionalQuery(leaderboardOptions),
                _Locale,
                _APIKey);

            leaderboard = await this.jsonUtility.GetDataFromURLAsync <LeaderboardRoot>(url);

            return(leaderboard);
        }
Пример #3
0
        /// <summary>
        /// Leaderboard for 2v2, 3v3, 5v5 or RBG
        /// </summary>
        /// <param name="leaderboardOptions">choose between 2v2, 3v3, 5v5 or RBG leaderboard</param>
        /// <returns>LeaderboardRoot object</returns>
        public async Task <LeaderboardRoot> GetLeaderboardAsync(LeaderboardOptions leaderboardOptions)
        {
            var url = $"{Host}/wow/leaderboard/{LeaderboardFields.BuildOptionalQuery(leaderboardOptions)}?locale={Locale}&apikey={APIKey}";

            return(await this._jsonUtility.GetDataFromURLAsync <LeaderboardRoot>(url));
        }