/// <summary> /// Add a screen to the manager. /// </summary> /// <param name="screen">A class that inheritted the screen class</param> public void AddScreen(Screen screen) { screen.Manager = this; /** Make sure that the content needed is loaded since initialization is only called once. */ screen.Initialize(); screen.TransitionEvent -= TransitionEventManager; screen.TransitionEvent += TransitionEventManager; ScreenList.Add(screen); }
/// <summary> /// Remove a screen from the manager. /// </summary> /// <param name="screen">A class that inheritted the screen class</param> public void RemoveScreen(Screen screen) { if (isInitialized) { screen.UnloadContent(); screen.TransitionEvent -= TransitionEventManager; } ScreenList.Remove(screen); }