Corgi Engine  v8.8
MoreMountains.Tools.MMSaveLoadManager Class Reference

Allows the save and load of objects in a specific folder and file. More...

Static Public Member Functions

static void Save (object saveObject, string fileName, string foldername=_defaultFolderName)
 Save the specified saveObject, fileName and foldername into a file on disk. More...
 
static object Load (System.Type objectType, string fileName, string foldername=_defaultFolderName)
 Load the specified file based on a file name into a specified folder More...
 
static void DeleteSave (string fileName, string folderName=_defaultFolderName)
 Removes a save from disk More...
 
static void DeleteSaveFolder (string folderName=_defaultFolderName)
 Deletes the whole save folder More...
 
static void DeleteAllSaveFiles ()
 Deletes all save files saved by this MMSaveLoadManager More...
 
static void DeleteDirectory (string target_dir)
 Deletes the specified directory More...
 

Static Public Attributes

static IMMSaveLoadManagerMethod SaveLoadMethod = new MMSaveLoadManagerMethodBinary()
 the method to use when saving and loading files (has to be the same at both times of course) More...
 

Detailed Description

Allows the save and load of objects in a specific folder and file.

How to use (at a minimum) :

Save : MMSaveLoadManager.Save(TestObject, FileName+SaveFileExtension, FolderName);

Load : TestObject = (YourObjectClass)MMSaveLoadManager.Load(typeof(YourObjectClass), FileName + SaveFileExtension, FolderName);

Delete save : MMSaveLoadManager.DeleteSave(FileName+SaveFileExtension, FolderName);

Delete save folder : MMSaveLoadManager.DeleteSaveFolder(FolderName);

You can also specify what IMMSaveLoadManagerMethod the system should use. By default it's binary but you can also pick binary encrypted, json, or json encrypted You'll find examples of how to set each of these in the MMSaveLoadTester class

Member Function Documentation

◆ DeleteAllSaveFiles()

static void MoreMountains.Tools.MMSaveLoadManager.DeleteAllSaveFiles ( )
static

Deletes all save files saved by this MMSaveLoadManager

◆ DeleteDirectory()

static void MoreMountains.Tools.MMSaveLoadManager.DeleteDirectory ( string  target_dir)
static

Deletes the specified directory

Parameters
target_dir

◆ DeleteSave()

static void MoreMountains.Tools.MMSaveLoadManager.DeleteSave ( string  fileName,
string  folderName = _defaultFolderName 
)
static

Removes a save from disk

Parameters
fileNameFile name.
folderNameFolder name.

◆ DeleteSaveFolder()

static void MoreMountains.Tools.MMSaveLoadManager.DeleteSaveFolder ( string  folderName = _defaultFolderName)
static

Deletes the whole save folder

Parameters
folderName

◆ Load()

static object MoreMountains.Tools.MMSaveLoadManager.Load ( System.Type  objectType,
string  fileName,
string  foldername = _defaultFolderName 
)
static

Load the specified file based on a file name into a specified folder

Parameters
fileNameFile name.
foldernameFoldername.

◆ Save()

static void MoreMountains.Tools.MMSaveLoadManager.Save ( object  saveObject,
string  fileName,
string  foldername = _defaultFolderName 
)
static

Save the specified saveObject, fileName and foldername into a file on disk.

Parameters
saveObjectSave object.
fileNameFile name.
foldernameFoldername.

Member Data Documentation

◆ SaveLoadMethod

IMMSaveLoadManagerMethod MoreMountains.Tools.MMSaveLoadManager.SaveLoadMethod = new MMSaveLoadManagerMethodBinary()
static

the method to use when saving and loading files (has to be the same at both times of course)


The documentation for this class was generated from the following file: