private void OnInterruptStateEnter(StateEnterArgs <TTrig, TName> triggerValue) { if (_action == null) { throw new NullReferenceException("Null state action"); } _action.Invoke(triggerValue); _stateMachine.Restore(_resetState); }
private async Task OnAsyncInterruptStateEnter(StateEnterArgs <TTrig, TName> arg) { if (_asyncAction == null) { throw new NullReferenceException("Null state async action"); } await _asyncAction.Invoke(arg); _stateMachine.Restore(_resetState); }
private void OnInterruptStateEnter(StateEnterArgs <TTrig, TName> triggerValue) { if (_action == null) { throw new NullReferenceException("Null state async action"); } if (_stateMachine.PreviousState == null) { throw new Exception("Previous state cannot be null"); } _action.Invoke(triggerValue); _stateMachine.Restore(_stateMachine.PreviousState); }
private void OnInterruptStateEnter(StateEnterArgs <TTrig, TName> triggerValue) { if (_action == null) { throw new NullReferenceException("Null state action"); } if (_stateMachine.PreviousState == null) { throw new Exception("Previous state cannot be null"); } _transitions.Remove(_returnTrig); AddTransition(_returnTrig, _stateMachine.PreviousState); _action.Invoke(triggerValue); }
private async Task OnAsyncInterruptStateEnter(StateEnterArgs <TTrig, TName> arg) { if (_asyncAction == null) { throw new NullReferenceException("Null state async action"); } if (_stateMachine.PreviousState == null) { throw new Exception("Previous state cannot be null"); } _transitions.Remove(_returnTrig); AddTransition(_returnTrig, _stateMachine.PreviousState); await _asyncAction.Invoke(arg); }
internal Task ActivateAsync(StateEnterArgs <TTrig, TName> value) { return(OnEnterAsync == null ? Task.CompletedTask : OnEnterAsync.Invoke(value)); }
internal void Activate(StateEnterArgs <TTrig, TName> value) { OnEnter?.Invoke(value); }