public bool IsInState(TState state) { if (state.CompareTo(State) == 0) { return(true); } return(_superState?.IsInState(state) ?? false); }
public void AddSuperState(IStateConfigurationAsyncInternal <T, TState, TTrigger> superStateConfiguration) { if (IsInState(superStateConfiguration.State)) { throw new ArgumentOutOfRangeException($"{State} is already a sub-state of {superStateConfiguration.State}."); } if (superStateConfiguration.IsInState(State)) { throw new ArgumentOutOfRangeException($"{superStateConfiguration.State} is already a sub-state of {State}."); } _superState = superStateConfiguration; }