Interface SaveDataStateManager


@ThreadSafe public interface SaveDataStateManager
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    delete(SaveData saveData)
    Tear down references related to this saved data and delete it from the storage.
    void
    forceSave(SaveData saveData)
    Force an immediate save that occurs even if not changed.
    void
    initializeWithAutosave(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 storage
    void
    Initialize your save data - reads from storage, and performs an initial save if not in storage
    void
    load(SaveData saveData)
    Manually load the save data.
    void
    Mark the data as changed so the next lazy save will write it to the storage
    void
    save(SaveData saveData)
    Lazy, non-blocking save if changed.
    void
    tearDown(SaveData saveData)
    Tear down references related to this save data so it can be garbage collected, and remove autosave if applicable.
  • Method Details

    • initializeWithAutosave

      void initializeWithAutosave(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 storage
    • initializeWithoutAutosave

      void initializeWithoutAutosave(SaveData saveData)
      Initialize your save data - reads from storage, and performs an initial save if not in storage
    • markChanged

      void markChanged(SaveData saveData)
      Mark the data as changed so the next lazy save will write it to the storage
    • load

      void load(SaveData saveData)
      Manually load the save data. This is only needed if you're reloading data or manually initializing without using initializeWithAutosave(dev.the_fireplace.lib.api.lazyio.interfaces.SaveData, short) or initializeWithoutAutosave(dev.the_fireplace.lib.api.lazyio.interfaces.SaveData)
    • save

      void save(SaveData saveData)
      Lazy, non-blocking save if changed.
    • forceSave

      void forceSave(SaveData saveData)
      Force an immediate save that occurs even if not changed.
    • tearDown

      void tearDown(SaveData saveData)
      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

      void delete(SaveData saveData)
      Tear down references related to this saved data and delete it from the storage.