public StateMachineUntilFinalStateEnumerator(
     TContext context,
     TStatefulTask initialTask,
     IReadOnlyDictionary <TStateId, TStatefulTask> transitionsTable,
     CustomStateMachineAction <TStateId> customAction)
 {
     Context           = context;
     _current          = initialTask.ThrowIfNull(nameof(initialTask));
     _transitionsTable = transitionsTable.ThrowIfNull(nameof(transitionsTable));
     _customAction     = customAction.ThrowIfNull(nameof(customAction));
 }
        public StraightforwardStateMachineEnumerator(
            TContext context,
            TStraightforwardStatefulTask initialTask,
            IReadOnlyList <TStraightforwardStatefulTask> transitionsList,
            CustomStateMachineAction <int> customAction)
        {
            Context          = context;
            _current         = initialTask.ThrowIfNull(nameof(initialTask));
            _transitionsList = transitionsList.ThrowIfNull(nameof(transitionsList));
            _customAction    = customAction.ThrowIfNull(nameof(customAction));

            _currentStateId = 0;
        }