//Use a stack to keep track of previous states
        //private Queue<GameState> z_previousStateQueue;
        //Constructor
        public GameStateManager(Game game)
        {
            this.z_game = game;
            //Get Game Services
            this.z_spriteBatch = ((SpriteBatch)this.z_game.Services.GetService(typeof(SpriteBatch)));
            this.z_content = ((ContentManager)this.z_game.Services.GetService(typeof(ContentManager)));
            this.z_graphics = ((GraphicsDevice)this.z_game.Services.GetService(typeof(GraphicsDevice)));
            this.z_viewPort = ((Rectangle)this.z_game.Services.GetService(typeof(Rectangle)));

            //Initialize States
            this.z_currentGameState = GameState.LoadingScreen;
            this.z_previousGameState = this.z_currentGameState;

            //Initialize Screens and Menus
            this.z_loadingScreen = new LoadingScreen(this.z_content.Load<Texture2D>("Content\\Screens\\LogoScreen"),
                                                     this.z_content.Load<Texture2D>("Content\\Screens\\LoadingStatic"));
            this.z_titleScreen = new TitleScreen(this.z_viewPort);
            this.z_MainMenuScreen = new MainMenuScreen(this.z_viewPort);
            this.z_MissionScreen = new MissionScreen(this.z_viewPort);

            this.z_listScreen = new List<IScreenMenu>();

            this.z_loadingManagerIsActive = true;
            this.addScreensToList();
            //this.z_previousStateQueue = new Queue<GameState>();
        }
Beispiel #2
0
        //Perform the first loading for the game
        public void InitialLoad(List<IScreenMenu> listScreen, ContentManager content, TitleScreen titleScreen)
        {
            //Load all necessary images/content for all Screens and Menus
            for (int i = 0; i < listScreen.Count; i++)
                listScreen[i].loadTexture(content);

            //Load all audio files into the AudioManager

            //this.z_initialLoadFinished = true;
        }
 public void setTitleScreen(TitleScreen newScreen)
 {
     this.z_titleScreen = newScreen;
 }