Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
 static ArkDataService()
 {
     ArkData = new ArkData();
     if (!DesignerProperties.GetIsInDesignMode(new DependencyObject()))
     {
         EnsureArkDataAvailability();
     }
 }
Ejemplo n.º 3
0
 public static void EnsureArkDataAvailability()
 {
     Task.Run(async() => {
         if (!File.Exists(filename))
         {
             await DownloadArkData();
         }
         else
         {
             ArkData = ArkDataReader.ReadFromFile(filename);
         }
     });
 }
Ejemplo n.º 4
0
        public static async Task DownloadArkData()
        {
            await tryDownload(new Uri(arkDataUrl), filename);

            ArkData = ArkDataReader.ReadFromFile(filename);
        }