Exemplo n.º 1
0
        public static void Complete(this Routine original)
        {
            if (original == null)
            {
                throw new NullReferenceException(nameof(original));
            }

            RoutineUtilities.CompleteWithoutChecks(original);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 5
0
 public float GetProgress()
 {
     return(RoutineUtilities.GetProgressFromRoutine(_sourceRoutine));
 }
 public RoutineProgressHandler(Routine routine)
 {
     _routine          = RoutineUtilities.GetProgressRoutineProvider(routine);
     _previousProgress = _routine.GetProgress();
 }