Loading...
Searching...
No Matches
AdventureCore.PersistenceContainer Class Reference

Detailed Description

central singleton manager behaviour for anything related to persistence
needs to be added to a scene for any persistence to take place
any persister in a scene has to go through this container to retrieve or modify persistence data
the container is responsible for managing the current data and passing it on to the PersistenceSaver to actually be saved to disk

https://adventure.softleitner.com/manual/persistence

Inheritance diagram for AdventureCore.PersistenceContainer:

Public Member Functions

virtual void Suspend (bool save=true)
 
virtual void Resume (bool save=true)
 
virtual bool ContainsArea (PersistenceArea area)
 
virtual bool ContainsKey (PersistenceArea area, string key)
 
virtual T Get< T > (PersistenceArea area, string key, T defaultValue=default)
 
virtual void Set< T > (PersistenceArea area, string key, T value)
 
virtual void Clear (PersistenceArea area)
 
virtual void Clear (PersistenceArea area, string key)
 
virtual void Load ()
 
virtual void Load (PersistenceArea area)
 
virtual void Save ()
 
virtual void Save (PersistenceArea area)
 
virtual void DeleteData (int? index=null, bool? global=null)
 
virtual void DeleteData (PersistenceArea area, int? index=null)
 
virtual void AddObserver (PersistenceArea area, string key, Action callback)
 
virtual void RemoveObserver (PersistenceArea area, string key, Action callback)
 
string GetKey (PersistenceArea area, int? index=null)
 

Static Public Member Functions

static string GetKey (string containerKey, int containerIndex, PersistenceArea area)
 

Public Attributes

string Key
 
int Index
 
string IndexVariableName
 
PersistenceSaverBase Saver
 
PersistenceArea[] Areas
 
bool AutoLoad = true
 
bool AutoSave = true
 
UnityEvent Saving
 

Static Public Attributes

static PersistenceContainer Instance