public void PushState(IApplicationState newState) { appStates.Peek().OnDisable(); newState.App = this; appStates.Push(newState); newState.OnEnable(); }
public Application(ApplicationSettings settings, IApplicationState startState) { Settings = settings; Window = CreateWindow(settings); Window.Closed += (sender, args) => Window.Close(); appStates = new Stack<IApplicationState>(); appStates.Push(startState); startState.App = this; startState.OnEnable(); }
public Application(ApplicationSettings settings, IApplicationState startState) { Settings = settings; Window = CreateWindow(settings); Window.Closed += (sender, args) => Window.Close(); appStates = new Stack <IApplicationState>(); appStates.Push(startState); startState.App = this; startState.OnEnable(); }