Пример #1
0
        /// <summary>
        /// Add a coordinate state to the state machine that is the initial state
        /// </summary>
        /// <param name="state"></param>
        public void AddEntryState(CoordinatingState <TBoolEnum, TTriggerEnum> state)
        {
            if (entryState != null)
            {
                throw new ArgumentException(
                          message: $"{state.Name} cannot be made the entry state because " +
                          $"{entryState} was already defined as the entry state.",
                          paramName: nameof(entryState));
            }

            AddState(state);
            entryState = state;
        }
Пример #2
0
 /// <summary>
 /// Add a coordinating state to the state machine
 /// </summary>
 /// <param name="state"></param>
 public void AddState(CoordinatingState <TBoolEnum, TTriggerEnum> state)
 {
     state.SetStateMachineFunctions(this, this);
     state.SetVerbose(verbose);
     stateTransitions.Add(state, new List <Transition <TBoolEnum, TTriggerEnum> >());
 }