internal SingleInternalArc(StateMachineFactory <Operand, State, Eventtype, Event>
                            _enclosing, STATE postState, SingleArcTransition <OPERAND, EVENT> hook)
 {
     this._enclosing = _enclosing;
     // transition hook
     this.postState = postState;
     this.hook      = hook;
 }
 /// <returns>
 /// a NEW StateMachineFactory just like
 /// <c>this</c>
 /// with the current
 /// transition added as a new legal transition
 /// Note that the returned StateMachineFactory is a distinct object.
 /// This method is part of the API.
 /// </returns>
 /// <param name="preState">pre-transition state</param>
 /// <param name="postState">post-transition state</param>
 /// <param name="eventType">stimulus for the transition</param>
 /// <param name="hook">transition hook</param>
 public StateMachineFactory <OPERAND, STATE, EVENTTYPE, EVENT> AddTransition(STATE
                                                                             preState, STATE postState, EVENTTYPE eventType, SingleArcTransition <OPERAND, EVENT
                                                                                                                                                  > hook)
 {
     return(new StateMachineFactory <OPERAND, STATE, EVENTTYPE, EVENT>(this, new StateMachineFactory.ApplicableSingleOrMultipleTransition
                                                                       <OPERAND, STATE, EVENTTYPE, EVENT>(preState, eventType, new StateMachineFactory.SingleInternalArc
                                                                                                              (this, postState, hook))));
 }
        /// <returns>
        /// a NEW StateMachineFactory just like
        /// <c>this</c>
        /// with the current
        /// transition added as a new legal transition
        /// Note that the returned StateMachineFactory is a distinct
        /// object.
        /// This method is part of the API.
        /// </returns>
        /// <param name="preState">pre-transition state</param>
        /// <param name="postState">post-transition state</param>
        /// <param name="eventTypes">List of stimuli for the transitions</param>
        /// <param name="hook">transition hook</param>
        public StateMachineFactory <OPERAND, STATE, EVENTTYPE, EVENT> AddTransition(STATE
                                                                                    preState, STATE postState, ICollection <EVENTTYPE> eventTypes, SingleArcTransition
                                                                                    <OPERAND, EVENT> hook)
        {
            StateMachineFactory <OPERAND, STATE, EVENTTYPE, EVENT> factory = null;

            foreach (EVENTTYPE @event in eventTypes)
            {
                if (factory == null)
                {
                    factory = AddTransition(preState, postState, @event, hook);
                }
                else
                {
                    factory = factory.AddTransition(preState, postState, @event, hook);
                }
            }
            return(factory);
        }