Exemple #1
0
        public void SaveToDisk()
        {
            DateTime stamp        = DateTime.Now;
            string   backupFolder = Path.Combine(Directory.GetParent(Executable.Path).ToString(), "HeroesResourceManagerBackups", stamp.ToString("yyyy-MM-dd-HHmmss"));

            Directory.CreateDirectory(backupFolder);

            SaveHeroExeData(backupFolder);

            if (CreatureManager.AnyChanges)
            {
                CreatureManager.SaveLocalChanges(this);
            }

            if (HeroesManager.AnyChanges)
            {
                HeroesManager.SaveLocalChanges(this);
            }

            if (HeroClass.AnyChanges)
            {
                HeroClass.SaveLocalChanges(this);
            }

            if (Spell.AnyChanges)
            {
                Spell.SaveLocalChanges(this);
            }


            foreach (var lodFile in ResourceFiles)
            {
                lodFile.SaveToDiskBackupAndSwap(backupFolder);
            }
        }
Exemple #2
0
        public void RefreshData()
        {
            routingCache  = new Dictionary <string, LodFile>();
            BackupManager = new BackupManager();

            Resource.Unload();
            CreatureAnimationLoop.Unload();
            BitmapCache.UnloadCachedDrawItems();

            HeroesManager.LoadInfo(this);
            HeroClass.LoadInfo(this);
            CreatureManager.LoadInfo(this);
            Spell.LoadInfo(this);
            SecondarySkill.LoadInfo(this);
            StringsData.LoadInfo(this);

            Speciality.LoadInfo(this);
            Town.LoadInfo(this);
            HeroExeData.LoadInfo(this);

            BackupManager.LoadData(this);
        }