Ejemplo n.º 1
0
        public static int GetTotalChampionScore(ChampionMasteryRegion _region, long _playerId)
        {
            if (_region == ChampionMasteryRegion.None)
            {
                return(0);
            }

            string  url        = string.Format(@"https://global.api.pvp.net/championmastery/location/{0}/player/{1}/score?api_key={2}", _region, _playerId, Helpers.apiKey);
            dynamic totalScore = Helpers.GetJSONObject(url);

            return((int)totalScore);
        }
Ejemplo n.º 2
0
        public static ChampionMasteryDto GetSpecificChampionMastery(ChampionMasteryRegion _region, long _playerId, long _championId)
        {
            if (_region == ChampionMasteryRegion.None)
            {
                return(null);
            }

            string  url             = string.Format(@"https://global.api.pvp.net/championmastery/location/{0}/player/{1}/champion/{2}?api_key={3}", _region, _playerId, _championId, Helpers.apiKey);
            dynamic championMastery = Helpers.GetJSONObject(url);

            return(new ChampionMasteryDto(championMastery));
        }
Ejemplo n.º 3
0
        public static List <ChampionMasteryDto> GetAllChampionMastery(ChampionMasteryRegion _region, long _playerId)
        {
            if (_region == ChampionMasteryRegion.None)
            {
                return(null);
            }

            string  url = string.Format(@"https://global.api.pvp.net/championmastery/location/{0}/player/{1}/champions?api_key={2}", _region, _playerId, Helpers.apiKey);
            dynamic championMasteries = Helpers.GetJSONObject(url);

            List <ChampionMasteryDto> returnMe = new List <ChampionMasteryDto>();

            foreach (dynamic championMastery in championMasteries["champions"])
            {
                returnMe.Add(new ChampionMasteryDto(championMastery));
            }

            return(returnMe);
        }