public void ChangeState(CGameState state) { if (states.Count > 0) { ((CGameState)states.Peek()).Cleanup(); states.Pop(); } states.Push(state); ((CGameState)states.Peek()).Init(); }
public void PushState(CGameState state) { if (states.Count > 0) { ((CGameState)states.Peek()).Pause(); } states.Push(state); ((CGameState)states.Peek()).Init(); }