예제 #1
0
        public static void Complete(this Routine original)
        {
            if (original == null)
            {
                throw new NullReferenceException(nameof(original));
            }

            RoutineUtilities.CompleteWithoutChecks(original);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }
예제 #5
0
 public float GetProgress()
 {
     return(RoutineUtilities.GetProgressFromRoutine(_sourceRoutine));
 }
 public RoutineProgressHandler(Routine routine)
 {
     _routine          = RoutineUtilities.GetProgressRoutineProvider(routine);
     _previousProgress = _routine.GetProgress();
 }