示例#1
0
        public static async Task CollectMainAsync(string arg)
        {
            var championIds = await StaticData.GetChampionIds();

            var client = await Client.Connect();

            var allStats = new List <ChampStats>();

            foreach (var championId in championIds)
            {
                var champStats = new ChampStats
                {
                    ChampionId       = championId,
                    StatsPerPosition = new List <CareerStats.ChampionQueueStatsDto>(),
                };

                foreach (Position position in Enum.GetValues(typeof(Position)))
                {
                    var stats = await client.CareerStats.GetChampionAverage(
                        championId,
                        position,
                        Tier.ALL,
                        Queue.rank5solo);

                    champStats.StatsPerPosition.Add(stats);
                }

                allStats.Add(champStats);
            }

            using (var outFile = File.OpenWrite(arg))
            {
                using (var writer = new StreamWriter(outFile, Encoding.UTF8))
                {
                    var serializeObject = JsonConvert.SerializeObject(allStats, Formatting.Indented);
                    await writer.WriteAsync(serializeObject);
                }
            }
        }
示例#2
0
 public GetKDA(string playerName, string ChampName)
 {
     stats = new ChampStats(ChampName, playerName);
 }
示例#3
0
 public GetKDA(string playerName, int ChampID)
 {
     stats = new ChampStats(ChampID, playerName);
 }
示例#4
0
 public GetKDA(int playerID, int ChampID)
 {
     stats = new ChampStats(ChampID, playerID);
 }
示例#5
0
 public GetKDA(int playerID, string ChampName)
 {
     stats = new ChampStats(ChampName, playerID);
 }
示例#6
0
文件: GetKDA.cs 项目: duylee/LOL-1
 public GetKDA(string playerName, string ChampName)
 {
     stats = new ChampStats(ChampName, playerName);
 }
示例#7
0
文件: GetKDA.cs 项目: duylee/LOL-1
 public GetKDA(int playerID, int ChampID)
 {
     stats = new ChampStats(ChampID, playerID);
 }
示例#8
0
文件: GetKDA.cs 项目: duylee/LOL-1
 public GetKDA(string playerName, int ChampID)
 {
     stats = new ChampStats(ChampID, playerName);
 }
示例#9
0
文件: GetKDA.cs 项目: duylee/LOL-1
 public GetKDA(int playerID, string ChampName)
 {
     stats = new ChampStats(ChampName, playerID);
 }