Class RaceTask

java.lang.Object
com.cdarobotics.cdalib.tasks.Task
com.cdarobotics.cdalib.tasks.RaceTask

public class RaceTask extends Task
Runs all of its child tasks at once and completes as soon as any one of them finishes. The remaining tasks are simply no longer polled.
  • Constructor Details

    • RaceTask

      public RaceTask(Task... tasks)
      Parameters:
      tasks - the tasks to run at once; the group finishes as soon as any one finishes.
  • Method Details

    • init

      public void init()
      Description copied from class: Task
      Called once before the first Task.run(). Set up state and issue starting commands here.
      Specified by:
      init in class Task
    • run

      public boolean run()
      Description copied from class: Task
      Called every loop after Task.init().
      Specified by:
      run in class Task
      Returns:
      true when the task is finished, false to keep running.
    • toString

      @NonNull public String toString()
      Specified by:
      toString in class Task