/// @param savable /// The savable to serialize to file /// public static void Save(this ISavable savable) { string filePath = string.Format(k_filePathFormat, savable.GetType().ToString()); if (FileSystem.DoesFileExist(filePath, FileSystem.Location.Persistent)) { // Create a backup automatically string backup = string.Format(k_filePathBackupFormat, savable.GetType().ToString()); FileSystem.CopyFile(filePath, backup, FileSystem.Location.Persistent); } // Queue the save var saveData = (Dictionary <string, object>)savable.Serialize(); GlobalDirector.Service <SaveService>().AddSaveJob(filePath, saveData); }