Exemplo n.º 1
0
        /// <summary>
        /// Adds a screen to the manager
        /// </summary>
        /// <param name="screen">The screen to be added</param>
        public void AddScreen(GameScreen screen)
        {
            //Sets the reference to the screen manager on the screen
            screen.ScreenManager = this;

            //If the screen manager is initialized, perform initialize operations
            //for the screens.
            if (this.isInitialized)
            {
                screen.LoadContent();
                screen.Initialize();
            }

            //Finally, add the screen to the list.
            screens.Add(screen);
        }