CustomSaveLocationHelper

interface CustomSaveLocationHelper

Contract for platform-specific helper classes to handle saving and loading games to and from arbitrary external locations

Functions

equals
Link copied to clipboard
open operator fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
open fun hashCode(): Int
loadGame
Link copied to clipboard
abstract fun loadGame(loadCompleteCallback: (GameInfo?, Exception?) -> Unit)

Loads a game from an external source asynchronously, then calls loadCompleteCallback with the loaded GameInfo. On success, this is also expected to set the loaded GameInfo's property customSaveLocation. Note that there is no hint so pass a default location or a way to remember the folder the user chose last time.

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

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.

toString
Link copied to clipboard
open fun toString(): String

Sources

jvm source
Link copied to clipboard