Package lib.commands
Class SwitchingIfElseCommand
java.lang.Object
edu.wpi.first.wpilibj2.command.Command
lib.commands.SwitchingIfElseCommand
- All Implemented Interfaces:
edu.wpi.first.util.sendable.Sendable
public class SwitchingIfElseCommand
extends edu.wpi.first.wpilibj2.command.Command
-
Nested Class Summary
Nested classes/interfaces inherited from class edu.wpi.first.wpilibj2.command.Command
edu.wpi.first.wpilibj2.command.Command.InterruptionBehavior -
Constructor Summary
ConstructorsConstructorDescriptionSwitchingIfElseCommand(edu.wpi.first.wpilibj2.command.Command onTrue, edu.wpi.first.wpilibj2.command.Command onFalse, BooleanSupplier... conditions) Similar toRunIfElse, but will switch which command is running mid-execution if the supplier changes. -
Method Summary
Methods inherited from class edu.wpi.first.wpilibj2.command.Command
addRequirements, addRequirements, alongWith, andThen, andThen, asProxy, beforeStarting, beforeStarting, cancel, deadlineFor, deadlineWith, finallyDo, finallyDo, getName, getRequirements, getSubsystem, handleInterrupt, hasRequirement, ignoringDisable, initSendable, isScheduled, onlyIf, onlyWhile, raceWith, repeatedly, schedule, setName, setSubsystem, unless, until, withDeadline, withInterruptBehavior, withName, withTimeout, withTimeout
-
Constructor Details
-
SwitchingIfElseCommand
public SwitchingIfElseCommand(edu.wpi.first.wpilibj2.command.Command onTrue, edu.wpi.first.wpilibj2.command.Command onFalse, BooleanSupplier... conditions) Similar toRunIfElse, but will switch which command is running mid-execution if the supplier changes.
-
-
Method Details
-
initialize
public void initialize()- Overrides:
initializein classedu.wpi.first.wpilibj2.command.Command
-
execute
public void execute()- Overrides:
executein classedu.wpi.first.wpilibj2.command.Command
-
end
public void end(boolean interrupted) - Overrides:
endin classedu.wpi.first.wpilibj2.command.Command
-
isFinished
public boolean isFinished()- Overrides:
isFinishedin classedu.wpi.first.wpilibj2.command.Command
-
runsWhenDisabled
public boolean runsWhenDisabled()- Overrides:
runsWhenDisabledin classedu.wpi.first.wpilibj2.command.Command
-
getInterruptionBehavior
public edu.wpi.first.wpilibj2.command.Command.InterruptionBehavior getInterruptionBehavior()- Overrides:
getInterruptionBehaviorin classedu.wpi.first.wpilibj2.command.Command
-