Example #1
0
        public bool ConnectSignal(Signal <TState, TTransition, TSignal> signal, Transition <TState, TTransition, TSignal> transition)
        {
            if (signal == null || transition == null)
            {
                return(false);
            }

            return(signal.AddTransition(transition) && transition.AddSignal(signal));
        }
Example #2
0
        public Signal <TState, TTransition, TSignal> CreateSignal(TSignal signalName, Transition <TState, TTransition, TSignal> transition)
        {
            if (transition == null)
            {
                return(null);
            }

            var machine = transition.MachineI;
            var signal  = new Signal <TState, TTransition, TSignal>(machine, signalName);

            signal.AddTransition(transition);
            transition.AddSignal(signal);
            machine.SignalMapI.Add(signal.Name, signal);

            if (machine != this)
            {
                this.SignalMapI.Add(signal.Name, signal);
            }

            return(signal);
        }