コード例 #1
0
        protected void setFSMStates()
        {
            CSLib.Framework.CFSMState tmpState = null;

            // 出现的状态
            tmpState = new CSLib.Framework.CFSMState(FSM_STATE_APPEAR);
            tmpState.addTransition(FSM_INPUT_ROLLING, FSM_STATE_ROLLING);
            m_fsmManager.addState(tmpState);

            // 旋转的状态
            tmpState = new CSLib.Framework.CFSMState(FSM_STATE_ROLLING);
            tmpState.addTransition(FSM_INPUT_DISAPPEAR, FSM_STATE_DISAPPEAR);
            m_fsmManager.addState(tmpState);

            // 消失的状态
            tmpState = new CSLib.Framework.CFSMState(FSM_STATE_DISAPPEAR);
            tmpState.addTransition(FSM_INPUT_DEATH, FSM_STATE_DEATH);
            m_fsmManager.addState(tmpState);

            // 死亡的状态
            tmpState = new CSLib.Framework.CFSMState(FSM_STATE_DEATH);
            tmpState.addTransition(FSM_INPUT_APPEAR, FSM_STATE_APPEAR);
            m_fsmManager.addState(tmpState);

            //
            fsmSetCurrentStateID(FSM_STATE_APPEAR);
        }
コード例 #2
0
ファイル: CFSMSample01.cs プロジェクト: yuka800/lop-lib
        protected void setFSMStates()
        {
            CSLib.Framework.CFSMState tmpState = null;

            // 出现的状态
            tmpState = new CSLib.Framework.CFSMState(FSM_STATE_APPEAR);
            tmpState.addTransition(FSM_INPUT_ROLLING, FSM_STATE_ROLLING);
            CFSMStateProcessAppear fsmStateProcessAppear = new CFSMStateProcessAppear(m_fsmManager);

            tmpState.addStateProcess(fsmStateProcessAppear);
            m_fsmManager.addState(tmpState);

            // 旋转的状态
            tmpState = new CSLib.Framework.CFSMState(FSM_STATE_ROLLING);
            tmpState.addTransition(FSM_INPUT_DISAPPEAR, FSM_STATE_DISAPPEAR);
            CFSMStateProcessRolling fsmStateProcessRolling = new CFSMStateProcessRolling(m_fsmManager);

            tmpState.addStateProcess(fsmStateProcessRolling);
            m_fsmManager.addState(tmpState);

            // 消失的状态
            tmpState = new CSLib.Framework.CFSMState(FSM_STATE_DISAPPEAR);
            tmpState.addTransition(FSM_INPUT_DEATH, FSM_STATE_DEATH);
            CFSMStateProcessDisappear fsmStateProcessDisappear = new CFSMStateProcessDisappear(m_fsmManager);

            tmpState.addStateProcess(fsmStateProcessDisappear);
            m_fsmManager.addState(tmpState);

            // 死亡的状态
            tmpState = new CSLib.Framework.CFSMState(FSM_STATE_DEATH);
            tmpState.addTransition(FSM_INPUT_APPEAR, FSM_STATE_APPEAR);
            CFSMStateProcessDeath fsmStateProcessDeath = new CFSMStateProcessDeath(m_fsmManager);

            tmpState.addStateProcess(fsmStateProcessDeath);
            m_fsmManager.addState(tmpState);

            //
            m_fsmManager.setCurrentStateID(FSM_STATE_APPEAR);
        }