The static class that manages storage for saving game data.
Methods
- Checks if a save file of the given name exists
Name Type Description saveName
string Name of the save file Returns:
Type Description boolean True if file exists, otherwise false - Gets the path to the save file directory
Returns:
Type Description string The path to the save file directory - Gets the path to the save file of the given name
Name Type Description saveName
string The name of the save file Returns:
Type Description string The path to the save file - Checks if a save key exists in browser storage
Name Type Description saveName
string Name of the save key Returns:
Type Description boolean True if key exists, else false - Gets the path to the save data of the given name
Name Type Description saveName
string The name of the save key Returns:
Type Description string The forage key for the given save name - Checks if localforage keys have been updated
Returns:
Type Description boolean True if keys are updated - A test key for localforage
Returns:
Type Description string The forage key for the test data - Makes a directory (synchronously)
Name Type Description path
string The path to make the directory - Reads a file (synchronously)
Name Type Description path
string The path to the file Returns:
Type Description string The contents of the file - Renames a file (synchronously)
Name Type Description oldPath
string The old path where the file existed newPath
string The new path to change the file to - Deletes a file (synchronously)
Name Type Description path
string The path to the file - Writes a file (synchronously)
Name Type Description path
string The path to the file data
string The data to write - Check if the game is running locally (Nwjs)
Returns:
Type Description boolean If game is running locally (mostly means not mobile/web) - Converts given JSON to object via parsing
Name Type Description json
string JSON string to convert to object Returns:
Type Description Promise Promise object of the converted object - Converts given JSON to zip
Name Type Description json
string JSON string to convert Returns:
Type Description Promise Promise object of the converted zip - Loads data from browser storage
Name Type Description saveName
string Name of the save key Returns:
Type Description Promise Promise object for loading data - Loads a file from the local environment
Name Type Description saveName
string Name of the save file Returns:
Type Description Promise Promise object for the data in the file - Load a saved object
Name Type Description saveName
string Name of the save file to load - Loads a zip formatted string
Name Type Description saveName
string Name of the save file Returns:
Type Description Promise Promise object for loading data - Checks if a save file of the given name exists locally
Name Type Description saveName
string Name of the save file Returns:
Type Description boolean True if file exists, otherwise false - Converts given object to JSON via stringify
Name Type Description object
Object Object to convert to JSON string Returns:
Type Description Promise Promise object of the converted JSON - Removes a given save file
Name Type Description saveName
string Name of the save file Returns:
Type Description Promise Promise object for removing a save file - Removes save data from browser storage
Name Type Description saveName
string Name of the save key - Removes a local save file
Name Type Description saveName
string Name of the save file - Save an object
Name Type Description saveName
string Name of the save file object
Object The object to save - Saves data to browser storage
Name Type Description saveName
string Name of the save key zip
string Zip string to save Returns:
Type Description Promise Promise object for saving - Saves a file to the local environment
Name Type Description saveName
string Name of the save file zip
string Zip string to save Returns:
Type Description Promise Promise object for saving the file - Saves a zip formatted string
Name Type Description saveName
string Name of the save file zip
string ZIP string to save Returns:
Type Description Promise Promise object for saving data - Update localforage save keys for browser storage
- Converts given zip to JSON
Name Type Description zip
string ZIP string to convert Returns:
Type Description Promise Promise object of the converted JSON