示例#1
0
        public SummonerInfo GetSummoner(string name, string region)
        {
            var pathBuilder  = new UrlPathBuilder();
            var summonerInfo = new SummonerInfo();

            summonerInfo.Summoner = GetSummonerByName(name, region);
            if (summonerInfo.Summoner.AccountId == null)
            {
                return(null);
            }

            summonerInfo.MatchHistory   = GetMatchHistoryOfSummoner(summonerInfo.Summoner.AccountId, region);
            summonerInfo.LeagueEntries  = GetLeagueEntriesOfSummoner(summonerInfo.Summoner.Id, region);
            summonerInfo.ProfileIconUrl = pathBuilder.GetProfileIconUrl(summonerInfo.Summoner.ProfileIconId);
            summonerInfo.LastPlayed     = SummonerInfoUtils.GetLastTimePlayedStr(summonerInfo.MatchHistory);
            summonerInfo.Region         = region;

            return(summonerInfo);
        }