Exemplo n.º 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}");
        }
Exemplo n.º 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.");
        }
Exemplo n.º 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.");
        }
Exemplo n.º 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);
        }
Exemplo n.º 5
0
 private static async Task UpdateLocalVarsFile(LeagueAPI_Variables localVars)
 {
     await LeagueAPI_DataCollector.UpdateLocalVarsFile(localVars);
 }