public void SetFirstScreen(Screen screen) { var component = Components.OfType<ScreenComponent>().FirstOrDefault(); Debug.Assert(component != null, "Could not resolve screen component!"); Debug.Assert(component.Count == 0, "A first screen has already been pushed to the stack."); component.Push(screen); }
public void Pop(Screen screen) { if (!_screens.Contains(screen)) { return; } _screens.Remove(screen); _screensToUpdate.Remove(screen); if (_isInitialized) { screen.UnloadContent(); } if (_screens.Count == 0) { Game.Exit(); } }
public void Push(Screen screen) { if (_screens.Contains(screen)) { return; } if (_isInitialized) { screen.Prepare(this); screen.Initialize(); screen.LoadContent(); } _screens.Add(screen); }
public void Push(Screen screen) { _owner.Push(screen); }