saveGame

abstract fun saveGame(gameInfo: GameInfo, gameName: String, forcePrompt: Boolean = false, saveCompleteCallback: (Exception?) -> Unit? = null)

Save to custom location

Saves a game asynchronously with a given default name and then calls the saveCompleteCallback callback upon completion. The saveCompleteCallback callback will be called from the same thread that this method is called from. If the GameInfo object already has the customSaveLocation property defined (not null), then the user will not be prompted to select a location for the save unless forcePrompt is set to true (think of this like "Save as...") On success, this is also expected to set customSaveLocation.

Parameters

gameInfo

Game data to save

gameName

Suggestion for the save name

forcePrompt

Bypass UI if location contained in gameInfo and forcePrompt==false

saveCompleteCallback

Action to call upon completion (success and failure)

Sources

jvm source
Link copied to clipboard