コード例 #1
0
        /// <summary>
        /// Registers an action to a transition.
        /// </summary>
        /// <param name="state">The target state.</param>
        /// <param name="letter">The target transitioning letter.</param>
        /// <param name="action">The action to be invoked.</param>
        /// <param name="direction">The directional constraint.</param>
        /// <param name="condition">The conditional constraint.</param>
        public void AddTransitionAction(S state, A letter, Action action, TransitionDirection direction = TransitionDirection.Exit, TransitionCondition condition = TransitionCondition.Always)
        {
            ActionInfo actionInfo = new ActionInfo(action);

            transitionActions.Add(state, letter, actionInfo, direction, condition);
        }
コード例 #2
0
        /// <summary>
        /// Registers an action to a state.
        /// </summary>
        /// <param name="state">The target state.</param>
        /// <param name="action">The action to be invoked.</param>
        /// <param name="direction">The directional constraint.</param>
        /// <param name="condition">The conditional constraint.</param>
        public void AddStateAction(S state, Action action, TransitionDirection direction = TransitionDirection.Enter, TransitionCondition condition = TransitionCondition.Always)
        {
            ActionInfo actionInfo = new ActionInfo(action);

            stateActions.Add(state, actionInfo, direction, condition);
        }