//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>(); }
public void setMissionScreen(MissionScreen newScreen) { this.z_MissionScreen = newScreen; }