Ejemplo n.º 1
0
        /// <summary>
        /// Add a new state.
        /// </summary>
        /// <param name="state">State to add.</param>
        /// <returns>State builder.</returns>
        /// <exception cref="ArgumentException">Thrown when the <paramref name="state"/> was already registered.</exception>
        public StateBuilder <TState, TEvent, TParameter> In(TState state)
        {
            if (states.ContainsKey(state))
            {
                throw new ArgumentException($"The state {state} was already registered.");
            }

            StateBuilder <TState, TEvent, TParameter> builder = new StateBuilder <TState, TEvent, TParameter>(this, state);

            states.Add(state, builder);
            return(builder);
        }
 internal MasterTransitionBuilder(StateBuilder <TState, TEvent> parent)
 => this.parent = parent;