public void RemoveState(AState state) { state.Pause(); state.Stop(); states.Remove(state); if (states.Count == 0) game.Exit(); states.Last().Resume(); }
//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); }