예제 #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();
 }
예제 #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;
 }
예제 #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);
     }
 }
예제 #4
0
파일: State.cs 프로젝트: secred/Tachycardia
 protected void PopAllAndPushState(State state)
 {
     m_StateManager.PopAllAndPushState(state);
 }
예제 #5
0
파일: State.cs 프로젝트: secred/Tachycardia
 protected void ChangeState(State state)
 {
     m_StateManager.ChangeState(state);
 }
예제 #6
0
파일: State.cs 프로젝트: secred/Tachycardia
 protected bool PushState(State state)
 {
     return m_StateManager.PushState(state);
 }
예제 #7
0
 public void Init(State state)
 {
     Core.Singleton.RenderWindow.ResetStatistics();
 }
예제 #8
0
 public void PopAllAndPushState(State state)
 {
     while (m_ActiveStateStack.Count > 0)
     {
         m_ActiveStateStack[0].Exit();
         m_ActiveStateStack.Remove(m_ActiveStateStack[0]);
     }
     PushState(state);
 }