public void ChangeState(State state) { if (m_ActiveStateStack.Count > 0) { m_ActiveStateStack[0].Exit(); m_ActiveStateStack.Remove(m_ActiveStateStack[0]); } m_ActiveStateStack.Insert(0, state); Init(state); state.Enter(); }
public bool PushState(State state) { if (m_ActiveStateStack.Count > 0) { if (!m_ActiveStateStack[0].Pause()) return false; } m_ActiveStateStack.Insert(0, state); Init(state); state.Enter(); return true; }
public void RegisterState(String stateName, State state) { try { if (!m_States.ContainsKey(stateName)) { m_States.Add(stateName, state); state.Initialize(this, stateName); } else throw new Exception("State `"+stateName+"` already registered!"); } catch (Exception e) { throw new Exception("Error while trying to add new state", e); } }
protected void PopAllAndPushState(State state) { m_StateManager.PopAllAndPushState(state); }
protected void ChangeState(State state) { m_StateManager.ChangeState(state); }
protected bool PushState(State state) { return m_StateManager.PushState(state); }
public void Init(State state) { Core.Singleton.RenderWindow.ResetStatistics(); }
public void PopAllAndPushState(State state) { while (m_ActiveStateStack.Count > 0) { m_ActiveStateStack[0].Exit(); m_ActiveStateStack.Remove(m_ActiveStateStack[0]); } PushState(state); }