using System; using JetBrains.Annotations; using Unity.Cloud.Collaborate.UserInterface; namespace Unity.Cloud.Collaborate.Models { internal interface IModel { /// /// Inform the presenter that the state of the model has changed. /// event Action StateChanged; /// /// Called when the model is started and the model should setup events and fetch data. /// void OnStart(); /// /// Called when the model should be stopped and data and events should closed. /// void OnStop(); /// /// Restores the state of the model from the provide cache. Must be called after OnStart. /// /// Cache to read the state from. void RestoreState([NotNull] IWindowCache cache); /// /// Saves the state of the model into the cache. Must be called before OnStop. /// /// Cache to save the state into. void SaveState([NotNull] IWindowCache cache); } }