private ImportSavegame(float gameTime) { this.gameTime = gameTime; // manual species-name fixing nameReplacing = new Dictionary <string, string> { { "Paraceratherium", "Paracer" }, { "Ichthyosaurus", "Ichthy" }, { "Dire Bear", "Direbear" } }; // add Blueprints of species (ark-tools doesn't convert e.g. the aberrant species) Regex r = new Regex(@"\/([^\/.]+)\."); foreach (Species s in Values.V.species) { Match m = r.Match(s.blueprintPath); if (!m.Success) { continue; } string bpPart = m.Groups[1].Value + "_C"; if (!nameReplacing.ContainsKey(bpPart)) { nameReplacing.Add(bpPart, s.name); } } arkData = ArkDataReader.ReadFromFile(FileService.GetJsonPath(FileService.ArkDataJson)); }
static ArkDataService() { ArkData = new ArkData(); if (!DesignerProperties.GetIsInDesignMode(new DependencyObject())) { EnsureArkDataAvailability(); } }
public static void EnsureArkDataAvailability() { Task.Run(async() => { if (!File.Exists(filename)) { await DownloadArkData(); } else { ArkData = ArkDataReader.ReadFromFile(filename); } }); }
public static async Task DownloadArkData() { await tryDownload(new Uri(arkDataUrl), filename); ArkData = ArkDataReader.ReadFromFile(filename); }