Exemple #1
0
 public StateTransition(int state, int command, int finishState, TransitionActionCallback transitionActionCallback, OnStateChangeCallback onStateChangeCallback)
 {
     _state   = state;
     _command = command;
     _transitionActionCallback = transitionActionCallback;
     _onStateChangeCallback    = onStateChangeCallback;
     _nextState = finishState;
 }
Exemple #2
0
        public void RegisterTransition(int state, int command, int finishState, TransitionActionCallback action)
        {
            if (state < 0 || command < 0 || finishState < 0)
            {
                return;
            }

            StateTransition transition = new StateTransition(state, command, finishState, action, SetState);

            if (_transitions.ContainsKey(transition.GetID()))
            {
                Log.Error(MessageGroup.Common, "Given transition is already registered in state machine named : " + Name);
                return;
            }
            _transitions[transition.GetID()] = transition;
        }