public void ShowScreen <T>() where T : BaseScreen { var screen = screens.Find(x => x is T); if (screen == null) { throw new Exception("Unknown screen " + typeof(T).Name); } if (screen != activeScreen) { if (activeScreen != null) { activeScreen.Hide(); } activeScreen = screen; guiSystem.Screen = screen.Gui; activeScreen.Show(); } }
public void RegisterScreen(BaseScreen screen) { screen.Build(this, contentManager); screens.Add(screen); }