示例#1
0
        /// <summary>
        /// Restores the backup folder created by <see cref="MoveToBackup"/>.
        /// Existing files in the data folder are overwritten by backup files.
        /// </summary>
        public void RestoreBackup()
        {
            var backupPath = _path + BackupFolder;

            DirectoryEx.MoveIfExists(backupPath + AssetsFolder, _assetsPath, true);
            FileUtils.MoveIfExists(backupPath + SkillTreeFile, _skillTreePath, true);
            FileUtils.MoveIfExists(backupPath + OptsFile, _optsPath, true);
            DirectoryEx.DeleteIfExists(backupPath);
        }
示例#2
0
        /// <summary>
        /// Moves the existing files to a backup folder.
        /// </summary>
        public void MoveToBackup()
        {
            var backupPath = _path + BackupFolder;

            DirectoryEx.DeleteIfExists(backupPath, true);
            Directory.CreateDirectory(backupPath);
            DirectoryEx.MoveIfExists(_assetsPath, backupPath + AssetsFolder, true);
            FileUtils.MoveIfExists(_skillTreePath, backupPath + SkillTreeFile, true);
            FileUtils.MoveIfExists(_optsPath, backupPath + OptsFile, true);
        }
示例#3
0
 /// <summary>
 /// Moves the files from the temp folder to the data folder.
 /// This instance must have been set to use temporary files.
 /// </summary>
 public void MoveTemp()
 {
     if (!_useTempDir)
     {
         throw new InvalidOperationException("This instance doesn't use temp directories");
     }
     DirectoryEx.MoveIfExists(_tempAssetsPath, _assetsPath, true);
     FileUtils.MoveIfExists(_tempSkillTreePath, _skillTreePath, true);
     FileUtils.MoveIfExists(_tempOptsPath, _optsPath, true);
     DirectoryEx.DeleteIfExists(_path + TempFolder);
 }