public Summonerv4(Summonerv4 s4) { accountId = s4.accountId; id = s4.id; name = s4.name; profileIconId = s4.profileIconId; puuid = s4.puuid; revisionDate = s4.revisionDate; summonerLevel = s4.summonerLevel; }
public Summonerv4(string summonerName) { WebClient wc = new WebClient(); wc.Headers.Add("X-Riot-Token", ApiKey.Apikey); wc.Headers.Add("Content-Type", "application/json;charset=utf-8"); string respose = wc.DownloadString($"https://na1.api.riotgames.com/lol/summoner/v4/summoners/by-name/{summonerName}"); //json into object Summonerv4 result = JsonConvert.DeserializeObject <Summonerv4>(respose); accountId = result.accountId; id = result.id; name = result.name; profileIconId = result.profileIconId; puuid = result.puuid; revisionDate = result.revisionDate; summonerLevel = result.summonerLevel; }