Пример #1
0
 /// <summary>
 /// Condition the specified builder and function.
 /// </summary>
 /// <returns>The condition.</returns>
 /// <param name="builder">Builder.</param>
 /// <param name="function">Function.</param>
 /// <typeparam name="T">The 1st type parameter.</typeparam>
 public static TaskBuilder <T> Condition <T>
 (
     this TaskBuilder <T> builder,
     TaskCondition <T> .Delegate function
 )
 {
     return(builder.Push(new TaskCondition <T>(function)));
 }
Пример #2
0
 /// <summary>
 /// Wait the specified builder and duration.
 /// </summary>
 /// <returns>The wait.</returns>
 /// <param name="builder">Builder.</param>
 /// <param name="duration">Duration.</param>
 /// <typeparam name="T">The 1st type parameter.</typeparam>
 public static TaskBuilder <T> Wait <T>
 (
     this TaskBuilder <T> builder,
     float duration
 )
 {
     return(builder.Push(new TaskWait <T>(duration)));
 }
Пример #3
0
 /// <summary>
 /// Action the specified builder and action.
 /// </summary>
 /// <returns>The action.</returns>
 /// <param name="builder">Builder.</param>
 /// <param name="action">Action.</param>
 /// <typeparam name="T">The 1st type parameter.</typeparam>
 public static TaskBuilder <T> Action <T>
 (
     this TaskBuilder <T> builder,
     TaskAction <T> .Delegate action
 )
 {
     return(builder.Push(new TaskAction <T>(action)));
 }
Пример #4
0
 /// <summary>
 /// Wait the specified builder, min and max.
 /// </summary>
 /// <returns>The wait.</returns>
 /// <param name="builder">Builder.</param>
 /// <param name="min">Minimum.</param>
 /// <param name="max">Max.</param>
 /// <typeparam name="T">The 1st type parameter.</typeparam>
 public static TaskBuilder <T> Wait <T>
 (
     this TaskBuilder <T> builder,
     float min,
     float max
 )
 {
     return(builder.Push(new TaskWait <T>(min, max)));
 }
Пример #5
0
 /// <summary>
 /// Parallel the specified builder, numRequiredToFail and numRequiredToSucced.
 /// </summary>
 /// <returns>The parallel.</returns>
 /// <param name="builder">Builder.</param>
 /// <param name="numRequiredToFail">Number required to fail.</param>
 /// <param name="numRequiredToSucced">Number required to succed.</param>
 /// <typeparam name="T">The 1st type parameter.</typeparam>
 public static TaskBuilder <T> Parallel <T>
 (
     this TaskBuilder <T> builder,
     int numRequiredToFail   = 1,
     int numRequiredToSucced = 1
 )
 {
     return(builder.Push(new TaskParallel <T>(
                             numRequiredToFail,
                             numRequiredToSucced
                             )));
 }
Пример #6
0
 /// <summary>
 /// Sequence the specified builder.
 /// </summary>
 /// <returns>The sequence.</returns>
 /// <param name="builder">Builder.</param>
 /// <typeparam name="T">The 1st type parameter.</typeparam>
 public static TaskBuilder <T> Sequence <T>(this TaskBuilder <T> builder)
 {
     return(builder.Push(new TaskSequence <T>()));
 }