Esempio n. 1
0
        private void fsmSetCurrentStateID(int iStateID)
        {
            int iTmpStateID = m_fsmManager.getCurrentStateID();

            fsmStateProcessOut(iTmpStateID);

            m_fsmManager.setCurrentStateID(iStateID);
            m_iCurStateID = m_fsmManager.getCurrentStateID();
            fsmStateProcessIn(m_iCurStateID);
        }
Esempio n. 2
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);
            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);
        }