mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[commands] Revamp Interruptible (#4192)
This commit is contained in:
@@ -8,8 +8,8 @@ using namespace frc2;
|
||||
|
||||
Button::Button(std::function<bool()> isPressed) : Trigger(isPressed) {}
|
||||
|
||||
Button Button::WhenPressed(Command* command, bool interruptible) {
|
||||
WhenActive(command, interruptible);
|
||||
Button Button::WhenPressed(Command* command) {
|
||||
WhenActive(command);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -25,8 +25,8 @@ Button Button::WhenPressed(std::function<void()> toRun,
|
||||
return *this;
|
||||
}
|
||||
|
||||
Button Button::WhileHeld(Command* command, bool interruptible) {
|
||||
WhileActiveContinous(command, interruptible);
|
||||
Button Button::WhileHeld(Command* command) {
|
||||
WhileActiveContinous(command);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -42,13 +42,13 @@ Button Button::WhileHeld(std::function<void()> toRun,
|
||||
return *this;
|
||||
}
|
||||
|
||||
Button Button::WhenHeld(Command* command, bool interruptible) {
|
||||
WhileActiveOnce(command, interruptible);
|
||||
Button Button::WhenHeld(Command* command) {
|
||||
WhileActiveOnce(command);
|
||||
return *this;
|
||||
}
|
||||
|
||||
Button Button::WhenReleased(Command* command, bool interruptible) {
|
||||
WhenInactive(command, interruptible);
|
||||
Button Button::WhenReleased(Command* command) {
|
||||
WhenInactive(command);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -64,8 +64,8 @@ Button Button::WhenReleased(std::function<void()> toRun,
|
||||
return *this;
|
||||
}
|
||||
|
||||
Button Button::ToggleWhenPressed(Command* command, bool interruptible) {
|
||||
ToggleWhenActive(command, interruptible);
|
||||
Button Button::ToggleWhenPressed(Command* command) {
|
||||
ToggleWhenActive(command);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user