Ejemplo n.º 1
0
 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();
 }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
 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);
     }
 }
Ejemplo n.º 4
0
 protected void PopAllAndPushState(State state)
 {
     m_StateManager.PopAllAndPushState(state);
 }
Ejemplo n.º 5
0
 protected void ChangeState(State state)
 {
     m_StateManager.ChangeState(state);
 }
Ejemplo n.º 6
0
 protected bool PushState(State state)
 {
     return m_StateManager.PushState(state);
 }
Ejemplo n.º 7
0
 public void Init(State state)
 {
     Core.Singleton.RenderWindow.ResetStatistics();
 }
Ejemplo n.º 8
0
 public void PopAllAndPushState(State state)
 {
     while (m_ActiveStateStack.Count > 0)
     {
         m_ActiveStateStack[0].Exit();
         m_ActiveStateStack.Remove(m_ActiveStateStack[0]);
     }
     PushState(state);
 }