Beispiel #1
0
 public void RemoveState(AState state)
 {
     state.Pause();
     state.Stop();
     states.Remove(state);
     if (states.Count == 0)
         game.Exit();
     states.Last().Resume();
 }
Beispiel #2
0
        //Add a new state and use that one from now on
        public void PushState(AState state)
        {
            if (states.Count != 0)
                states.Last().Pause();

            state.Initialize();
            state.Start();
            state.Resume();

            states.Add(state);
        }