Пример #1
0
 public PlayerStats(
     Ability[] abilities, Champion champion, double currentGold,
     FullRunes fullRunes,
     int level, string summonerName)
 {
     this.abilities    = abilities;
     this.champion     = champion;
     this.currentGold  = currentGold;
     this.fullRunes    = fullRunes;
     this.level        = level;
     this.summonerName = summonerName;
 }
Пример #2
0
        /// <summary>
        /// Returns a class holding various stats about the active player.
        /// </summary>
        /// <returns></returns>
        public async Task <PlayerStats> GetActivePlayerStats()
        {
            JToken json = await basicApi.CallApiForJson(Requests.ACTIVE_PLAYER_DATA);

            if (json == null)
            {
                return(null);
            }

            JToken jsonAbilities = json["abilities"];
            JToken jsonChampion  = json["championStats"];
            JToken jsonFullRunes = json["fullRunes"];

            Ability[] abilities    = ReadAbilitiesFromJson(jsonAbilities);
            Champion  champion     = ReadFromJson <Champion>(jsonChampion);
            double    currentGold  = (double)json["currentGold"];
            FullRunes fullRunes    = ReadFullRunesFromJson(jsonFullRunes);
            int       level        = (int)json["level"];
            string    summonerName = (string)json["summonerName"];

            return(new PlayerStats(abilities, champion, currentGold, fullRunes, level, summonerName));
        }