[commands] Revamp Interruptible (#4192)

This commit is contained in:
Starlight220
2022-08-30 07:53:47 +03:00
committed by GitHub
parent f2a8d38d2a
commit c3a93fb995
26 changed files with 369 additions and 592 deletions

View File

@@ -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;
}