2 using System.Collections.Generic;
5 using Microsoft.Xna.Framework;
6 using Microsoft.Xna.Framework.Graphics;
8 namespace SuperPolarity
10 static class ScreenManager
12 static Stack<Screen> Screens;
13 static SuperPolarity Game;
15 static ScreenManager()
17 Screens = new Stack<Screen>();
20 static public void Push(Screen screen)
22 if (Screens.Count > 0)
24 Screens.Peek().Active = false;
32 static public void Pop()
34 var screen = Screens.Pop();
35 screen.Active = false;
37 Screens.Peek().Active = true;
40 static public void Update(GameTime gameTime)
42 Screens.Peek().Update(gameTime);
45 static public void Draw(SpriteBatch spriteBatch)
47 Screens.Peek().Draw(spriteBatch);
50 internal static void SetGame(SuperPolarity game)