Class

AppStorage

AppStorage(context)

App storage.
Constructor

# new AppStorage(context)

Create a new app storage instance.
Parameters:
Name Type Description
context BrowserWindow the electron browser window

View Source app/Storage.js, line 11

Members

BrowserWindow

# context

context - the electron browser window

View Source app/Storage.js, line 34

string

# path

path - the path to the game directory e.g. %USER%/.undeadbytesgame/

View Source app/Storage.js, line 24

array

# savedGames

savedGames - array to contain saved games

View Source app/Storage.js, line 66

string

# savedGamesDir

savedGamesDir - the full path to the saved games directory

View Source app/Storage.js, line 60

object

# settings

settings - the default game settings

View Source app/Storage.js, line 46

string

# settingsFile

settingsFile - the full path to the settings file

View Source app/Storage.js, line 40

Methods

# async loadGameFromFile() → {Promise}

Load a saved game object from a save file.

View Source app/Storage.js, line 148

Promise

# loadSavedGamesFromDir() → {void}

Load saved games from the saved games diretory.

View Source app/Storage.js, line 133

;
void

# loadSettingsFromFile() → {Object}

Load game settings from file.

View Source app/Storage.js, line 99

Object

# saveGameToFile(save) → {void}

Save a game object to a new save file.
Parameters:
Name Type Description
save Object the save game object

View Source app/Storage.js, line 180

void

# saveSettingsToFile(settings) → {void}

Save game settings to file.
Parameters:
Name Type Description
settings Object

View Source app/Storage.js, line 118

void