示例#1
0
 public async Task EnsureSpeciesIsLoaded(string speciesName)
 {
     if (LoadedSpecies.Contains(speciesName))
     {
         return;
     }
     await LoadSpecies(speciesName);
 }
示例#2
0
        private async Task LoadSpecies(string speciesName)
        {
            // Lookup class id
            var speciesId = ClassMapping[speciesName];

            // Read class file
            var path = Path.Combine(outputDir, speciesId + JSON_SUFFIX);

            if (File.Exists(path))
            {
                var contents = await ReadFileAsync(path);

                FoundDinos[speciesName] = JsonConvert.DeserializeObject <List <Dino> >(contents);
            }
            else
            {
                FoundDinos[speciesName] = new List <Dino>();
            }
            LoadedSpecies.Add(speciesName);
        }
示例#3
0
        private async Task RunArkTools()
        {
            if (executing)
            {
                Console.WriteLine("Skipping concurrent conversion");
                return;
            }

            executing = true;
            try
            {
                await ExecuteArkTools(Tamed? "tamed" : "wild", Properties.Settings.Default.SaveFile, outputDir);
            }
            finally
            {
                executing = false;
            }

            // Clear previously loaded data
            ClassMapping.Clear();
            LoadedSpecies.Clear();
            FoundDinos.Clear();
        }