コード例 #1
0
        public async Task <string> GetProgress()
        {
            LeagueAPI_Variables localVars = await ReadLocalVarsFile();

            if (localVars == null)
            {
                return("No data being collected.");
            }
            return($"Progress is: {localVars.CurrentProgress}");
        }
コード例 #2
0
        public async Task <string> WriteCurrentlyCollectedData()
        {
            LeagueAPI_Variables localVars = await ReadLocalVarsFile();

            if (localVars == null)
            {
                return("No data being collected.");
            }
            localVars.WriteCurrentlyCollectedData = true;
            await UpdateLocalVarsFile(localVars);

            return($"The request to write currently collected data was successful.");
        }
コード例 #3
0
        public async Task <string> StopCollectingData()
        {
            LeagueAPI_Variables localVars = await ReadLocalVarsFile();

            if (localVars == null)
            {
                return("No data being collected.");
            }
            localVars.StopCollectingData = true;
            await UpdateLocalVarsFile(localVars);

            return($"The request to stop collecting data was successful.");
        }
コード例 #4
0
        public async Task <string> CollectData(string apiKey, int maxCountOfGames = 0)
        {
            LeagueAPI_Variables localVars = await ReadLocalVarsFile();

            if (localVars != null)
            {
                return("Data already being collected.");
            }

            LeagueAPI_DataCollector dataCollector = new(apiKey);
            string result = await dataCollector.CollectMatchesData(maxCountOfGames : maxCountOfGames);

            return(result);
        }
コード例 #5
0
 private static async Task UpdateLocalVarsFile(LeagueAPI_Variables localVars)
 {
     await LeagueAPI_DataCollector.UpdateLocalVarsFile(localVars);
 }