Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Commands.runIf(...) as command factory method to Commands #7808

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
Update wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command…
…/Commands.java

Co-authored-by: Joseph Eng <91924258+KangarooKoala@users.noreply.github.com>
otter502 and KangarooKoala authored Mar 18, 2025
commit 4e4a7a7de1c1de9c96357f5dd9492d7783bd8fbd
Original file line number Diff line number Diff line change
@@ -167,7 +167,9 @@ public static Command either(Command onTrue, Command onFalse, BooleanSupplier se
}

/**
* Runs a command if the boolean condition function is true otherwise it does nothing and exits.
* Runs a command if the boolean condition function is true. Otherwise it does nothing and exits
* (but still has the same requirements as the command, interrupting any commands with shared
* requirements).
*
* @param condition the condition function
* @param onTrue the command to run if the condition function returns true