java.lang.Object
technology.sola.engine.storage.FileSaveStorage
- All Implemented Interfaces:
SaveStorage
A
SaveStorage implementation that stores saves on the file system.-
Field Summary
Fields inherited from interface technology.sola.engine.storage.SaveStorage
DEFAULT_SAVE_DIRECTORY, LOGGER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidchangeSaveDirectory(String path) Changes the directory in which saves are stored.voidDeletes a save.booleanChecks if a save exists.voidLoads a save.voidPersists a save.
-
Constructor Details
-
FileSaveStorage
public FileSaveStorage()
-
-
Method Details
-
changeSaveDirectory
Description copied from interface:SaveStorageChanges the directory in which saves are stored.- Specified by:
changeSaveDirectoryin interfaceSaveStorage- Parameters:
path- the path to where saves should be stored
-
load
Description copied from interface:SaveStorageLoads a save. The loaded save will be passed to the onSuccess callback.- Specified by:
loadin interfaceSaveStorage- Parameters:
path- the path to the saveonSuccess- callback that is called when the save is loaded successfullyonFailure- callback that is called when the save fails to load
-
save
Description copied from interface:SaveStoragePersists a save.- Specified by:
savein interfaceSaveStorage- Parameters:
path- the path to the savecontent- the content of the save to be persistedonSuccess- callback that is called when the save is persisted successfullyonFailure- callback that is called when the save fails to persist
-
delete
Description copied from interface:SaveStorageDeletes a save.- Specified by:
deletein interfaceSaveStorage- Parameters:
path- the path to the saveonSuccess- the callback that is called when the save is deleted successfullyonFailure- the callback that is called when the save fails to delete
-
exists
Description copied from interface:SaveStorageChecks if a save exists.- Specified by:
existsin interfaceSaveStorage- Parameters:
path- the path to the save- Returns:
- true if the save exists
-