mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[commands] Add ConditionalCommand getInterruptionBehavior (#5161)
This commit is contained in:
@@ -73,6 +73,16 @@ public class ConditionalCommand extends CommandBase {
|
||||
return m_onTrue.runsWhenDisabled() && m_onFalse.runsWhenDisabled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public InterruptionBehavior getInterruptionBehavior() {
|
||||
if (m_onTrue.getInterruptionBehavior() == InterruptionBehavior.kCancelSelf
|
||||
|| m_onFalse.getInterruptionBehavior() == InterruptionBehavior.kCancelSelf) {
|
||||
return InterruptionBehavior.kCancelSelf;
|
||||
} else {
|
||||
return InterruptionBehavior.kCancelIncoming;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initSendable(SendableBuilder builder) {
|
||||
super.initSendable(builder);
|
||||
|
||||
Reference in New Issue
Block a user