Skip to content

Commit 308830b

Browse files
committed
Fixed oopsies
1 parent f983420 commit 308830b

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed

wpilibNewCommands/src/main/native/cpp/frc2/command/CommandPtr.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,14 @@ CommandPtr CommandPtr::IgnoringDisable(bool doesRunWhenDisabled) && {
7676
return std::move(*this);
7777
}
7878

79+
CommandPtr CommandPtr::IgnoreDisable() && {
80+
return std::move(*this).IgnoringDisable(true);
81+
}
82+
83+
CommandPtr CommandPtr::RespectDisable() && {
84+
return std::move(*this).IgnoringDisable(false);
85+
}
86+
7987
using InterruptionBehavior = Command::InterruptionBehavior;
8088
class InterruptBehaviorCommand : public WrapperCommand {
8189
public:

wpilibNewCommands/src/main/native/include/frc2/command/Command.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,22 @@ class Command : public wpi::Sendable, public wpi::SendableHelper<Command> {
352352
[[nodiscard]]
353353
CommandPtr IgnoringDisable(bool doesRunWhenDisabled) &&;
354354

355+
/**
356+
* Decorates this command to run when disabled.
357+
*
358+
* @return the decorated command
359+
*/
360+
[[nodiscard]]
361+
CommandPtr IgnoreDisable() &&;
362+
363+
/**
364+
* Decorates this command to stop when disabled.
365+
*
366+
* @return the decorated command
367+
*/
368+
[[nodiscard]]
369+
CommandPtr RespectDisable() &&;
370+
355371
/**
356372
* Decorates this command to have a different interrupt behavior.
357373
*

wpilibNewCommands/src/main/native/include/frc2/command/CommandPtr.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,22 @@ class CommandPtr final {
7272
[[nodiscard]]
7373
CommandPtr IgnoringDisable(bool doesRunWhenDisabled) &&;
7474

75+
/**
76+
* Decorates this command to run when disabled.
77+
*
78+
* @return the decorated command
79+
*/
80+
[[nodiscard]]
81+
CommandPtr IgnoreDisable() &&;
82+
83+
/**
84+
* Decorates this command to stop when disabled.
85+
*
86+
* @return the decorated command
87+
*/
88+
[[nodiscard]]
89+
CommandPtr RespectDisable() &&;
90+
7591
/**
7692
* Decorates this command to have a different interrupt behavior.
7793
*

0 commit comments

Comments
 (0)