using System; namespace Framework.Storage.Containers { /// Container providing access to persistent settings of the game /// Type of state stored in the container public interface IPersistentContainer where TState : class { #if false /// Triggered when the settings should be reapplied /// /// /// Typically, you don't want to tightly integrate all your character controllers /// and other game logic with the persistent state saving system and instead /// create 'glue' objects which take the settings from a persistent container /// and apply them at will. /// /// /// This event can be used to signal to those 'glue' objects that they should /// apply the current settings to the game's controllers again. /// /// /// One danger of this event is that dead objects may keep hanging on to it. /// Any 'glue' component needs to cleanly unsubscribe when it is being destroyed! /// /// event Action Apply; #endif /// Accesses the informations stored in the state TState Access(); /// Accesses the game-specific state /// /// Game-specific type of state the game is storing /// /// The game-specific state TSpecificState Access() where TSpecificState : TState; /// Loads the saved state of the container from disk void Load(); /// Saves the current state of the container to disk void Save(); /// Resets the container to its default settings void Reset(); } } // namespace Framework.Storage.Containers