Interface SaveDataStateManager
@ThreadSafe
public interface SaveDataStateManager
-
Method Summary
Modifier and TypeMethodDescriptionvoidTear down references related to this saved data and delete it from the storage.voidForce an immediate save that occurs even if not changed.voidinitializeWithAutosave(SaveData saveData, short saveIntervalInMinutes) Initialize your save data - reads from storage, prepares autosave to lazy save at the specified interval, and marks it as changed for an initial save if not in storagevoidinitializeWithoutAutosave(SaveData saveData) Initialize your save data - reads from storage, and performs an initial save if not in storagevoidManually load the save data.voidmarkChanged(SaveData saveData) Mark the data as changed so the next lazy save will write it to the storagevoidLazy, non-blocking save if changed.voidTear down references related to this save data so it can be garbage collected, and remove autosave if applicable.
-
Method Details
-
initializeWithAutosave
Initialize your save data - reads from storage, prepares autosave to lazy save at the specified interval, and marks it as changed for an initial save if not in storage -
initializeWithoutAutosave
Initialize your save data - reads from storage, and performs an initial save if not in storage -
markChanged
Mark the data as changed so the next lazy save will write it to the storage -
load
Manually load the save data. This is only needed if you're reloading data or manually initializing without usinginitializeWithAutosave(dev.the_fireplace.lib.api.lazyio.interfaces.SaveData, short)orinitializeWithoutAutosave(dev.the_fireplace.lib.api.lazyio.interfaces.SaveData) -
save
Lazy, non-blocking save if changed. -
forceSave
Force an immediate save that occurs even if not changed. -
tearDown
Tear down references related to this save data so it can be garbage collected, and remove autosave if applicable. Does not delete the saved data from the storage. -
delete
Tear down references related to this saved data and delete it from the storage.
-