Skip to content

NewgroundsIO.objects.SaveSlot

PsychoGoldfishNG edited this page Aug 30, 2022 · 5 revisions

Classes

SaveSlot

Contains information about a CloudSave slot.

Typedefs

getDataCallback : function
responseCallback : function

SaveSlot

Contains information about a CloudSave slot.

Kind: global class

new SaveSlot(props)

Constructor

Param Type Description
props object An object of initial properties for this instance
props.id Number The slot number.
props.size Number The size of the save data in bytes.
props.datetime String A date and time (in ISO 8601 format) representing when this slot was last saved.
props.timestamp Number A unix timestamp representing when this slot was last saved.
props.url String The URL containing the actual save data for this slot, or null if this slot has no data.

saveSlot.id : Number

The slot number.

Kind: instance property of SaveSlot

saveSlot.size : Number

The size of the save data in bytes.

Kind: instance property of SaveSlot

saveSlot.datetime : String

A date and time (in ISO 8601 format) representing when this slot was last saved.

Kind: instance property of SaveSlot

saveSlot.timestamp : Number

A unix timestamp representing when this slot was last saved.

Kind: instance property of SaveSlot

saveSlot.url : String

The URL containing the actual save data for this slot, or null if this slot has no data.

Kind: instance property of SaveSlot

saveSlot.hasData

This will be true if this save slot has any saved data.

Kind: instance property of SaveSlot

saveSlot.getData(callback, thisArg)

Loads the save file for this slot then passes its contents to a callback function.

Kind: instance method of SaveSlot

Param Type Description
callback getDataCallback A function to call when your data is loaded.
thisArg object An optional object to use as 'this' in your callback function.

saveSlot.setData(data, callback, thisArg)

Unlocks this medal, then fires a callback.

Kind: instance method of SaveSlot

Param Type Description
data string The data, in a serialized string, you want to save.
callback responseCallback An optional function to call when the data is saved on the server.
thisArg object An optional object to use as 'this' in your callback function.

saveSlot.clearData(callback, thisArg)

Clears all data from this slot, then fires a callback

Kind: instance method of SaveSlot

Param Type Description
callback responseCallback An optional function to call when the data is cleared from the server.
thisArg object An optional object to use as 'this' in your callback function.

saveSlot.getDate() ⇒ Date

Gets the date this slot was last updated.

Kind: instance method of SaveSlot

getDataCallback : function

Kind: global typedef

Param Type Description
data string The data loaded from the server

responseCallback : function

Kind: global typedef

Param Type
serverResponse NewgroundsIO.objects.Response
Clone this wiki locally