Skip to content

Commit

Permalink
Add AutoRoutine.listen()
Browse files Browse the repository at this point in the history
  • Loading branch information
bryceroethel committed Dec 6, 2024
1 parent c7a3ffc commit a421511
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions choreolib/src/main/java/choreo/auto/AutoRoutine.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,16 @@ public EventLoop loop() {
return loop;
}

/**
* Creates a {@link Trigger} that is bound to the routine's event loop.
*
* @param condition The condition represented by the trigger.
* @return A {@link Trigger} that is {@code true} when the condition is satisfied.
*/
public Trigger listen(BooleanSupplier condition) {
return new Trigger(loop, condition);
}

/**
* Gets the poll count of the routine.
*
Expand Down

0 comments on commit a421511

Please sign in to comment.