Beispiel #1
0
        void ConfigureStateMachine()
        {
            m_StateMachine = new SimpleStateMachine <PurchasingServiceToggleEvent>();

            m_StateMachine.AddEvent(PurchasingServiceToggleEvent.Disabled);
            m_StateMachine.AddEvent(PurchasingServiceToggleEvent.Enabled);

            m_DisabledState = new PurchasingDisabledState(m_StateMachine);
            m_EnabledState  = new PurchasingEnabledState(m_StateMachine);

            m_StateMachine.AddState(m_DisabledState);
            m_StateMachine.AddState(m_EnabledState);
        }
        void ConfigureStateMachine()
        {
            m_StateMachine = new SimpleStateMachine <bool>();

            m_StateMachine.AddEvent(false);
            m_StateMachine.AddEvent(true);

            m_DisabledState = new PurchasingDisabledState(m_StateMachine);
            m_EnabledState  = new PurchasingEnabledState(m_StateMachine);

            m_StateMachine.AddState(m_DisabledState);
            m_StateMachine.AddState(m_EnabledState);
        }