public static void Complete(this Routine original) { if (original == null) { throw new NullReferenceException(nameof(original)); } RoutineUtilities.CompleteWithoutChecks(original); }
public static void Complete(this Routine original, TimeSpan timeout) { if (original == null) { throw new NullReferenceException(nameof(original)); } var timeoutDuration = timeout.Duration(); RoutineUtilities.CompleteWithoutChecks(original, timeoutDuration); }
public static void Complete(this Routine original, float timeoutSeconds) { if (original == null) { throw new NullReferenceException(nameof(original)); } var timeoutAbs = Mathf.Abs(timeoutSeconds); var timeoutTimeSpan = TimeSpan.FromSeconds(timeoutAbs); RoutineUtilities.CompleteWithoutChecks(original, timeoutTimeSpan); }
public TResult WaitResult() { RoutineUtilities.CompleteWithoutChecks(this); if (IsError) { throw new RoutineErrorException( "It is impossible to get the result of the routine, because the routine contains an error"); } return(_result); }
public float GetProgress() { return(RoutineUtilities.GetProgressFromRoutine(_sourceRoutine)); }
public RoutineProgressHandler(Routine routine) { _routine = RoutineUtilities.GetProgressRoutineProvider(routine); _previousProgress = _routine.GetProgress(); }