Esempio n. 1
0
        public void PushScreen(GameScreen gs)
        {
            //add gs to relevant data structures
            theGame.Components.Add(gs);
            screens.Push(gs);
            OnScreenChange += gs.ScreenChange;

            //ScreenManager fires the event
            ScreenEventArgs e = new ScreenEventArgs(gs);
            if (OnScreenChange != null)     //the list is not empty
                OnScreenChange(this, e);    //fire event
        }
Esempio n. 2
0
        public void StartNewScreenSequence(GameScreen gs)
        {
            //empty the stack
            while (screens.Count > 0)
            {
                GameScreen top = (GameScreen)screens.Peek();
                OnScreenChange -= top.ScreenChange;
                theGame.Components.Remove(top);
                screens.Pop();
            }

            //procede as with PushScreen
            PushScreen(gs);
        }
Esempio n. 3
0
 public ScreenEventArgs(GameScreen gameScreen)
 {
     gs = gameScreen;
 }