Beispiel #1
0
 public void EndState()
 {
     if (m_cCurrentState != null)
     {
         m_cCurrentState.Exit();
     }
     m_cCurrentState = null;
 }
Beispiel #2
0
 public void SetState(CStateBase <TYPE> state)
 {
     m_CurrentState = state;
     if (m_CurrentState != null)
     {
         m_CurrentState.Enter(m_Object);
     }
 }
Beispiel #3
0
    public void ChangeState(CStateBase <Template> _cState)
    {
        if (m_cCurrentState != null)
        {
            m_cCurrentState.Exit();
        }

        m_cCurrentState = _cState;
        m_cCurrentState.Enter();
    }
Beispiel #4
0
        public void ChangeState(CStateBase <TYPE> state)
        {
            m_NextState    = state;
            m_PreviosState = m_CurrentState;
            if (m_PreviosState != null)
            {
                m_PreviosState.Exit(m_Object);
            }

            if (m_NextState == null)
            {
                return;
            }
            m_CurrentState = m_NextState;
            m_NextState.Enter(m_Object);
        }
Beispiel #5
0
 public CStateMachine()
 {
     m_cCurrentState = null;
 }
Beispiel #6
0
 public void Release()
 {
     m_Object = default(TYPE);
     m_CurrentState.Release();
     m_CurrentState = null;
 }
Beispiel #7
0
 protected virtual void OnStateInterrupted(CStateBase <FSM, ENUM_STATE> pStateInterrupt)
 {
 }
Beispiel #8
0
 public StateMachine(TYPE type)
 {
     m_Object       = type;
     m_CurrentState = null;
 }
Beispiel #9
0
 protected virtual void OnStateLeave(CStateBase <FSM, ENUM_STATE> pNextState)
 {
 }
Beispiel #10
0
 protected virtual void OnStateEnter(CStateBase <FSM, ENUM_STATE> pPrevState)
 {
 }
Beispiel #11
0
 public void EventStateInterrupted(CStateBase <FSM, ENUM_STATE> pStateInterrupt)
 {
     OnStateInterrupted(pStateInterrupt);
 }
Beispiel #12
0
 public void EventStateLeave(CStateBase <FSM, ENUM_STATE> pNextState)
 {
     OnStateLeave(pNextState);
 }
Beispiel #13
0
 public void EventStateEnter(CStateBase <FSM, ENUM_STATE> pPrevState)
 {
     OnStateEnter(pPrevState);
 }