Package lib.commands

Class RunIfElse

java.lang.Object
edu.wpi.first.wpilibj2.command.Command
edu.wpi.first.wpilibj2.command.ConditionalCommand
lib.commands.RunIfElse
All Implemented Interfaces:
edu.wpi.first.util.sendable.Sendable
Direct Known Subclasses:
RunIf, RunUnless

public class RunIfElse extends edu.wpi.first.wpilibj2.command.ConditionalCommand
  • Nested Class Summary

    Nested classes/interfaces inherited from class edu.wpi.first.wpilibj2.command.Command

    edu.wpi.first.wpilibj2.command.Command.InterruptionBehavior
  • Constructor Summary

    Constructors
    Constructor
    Description
    RunIfElse(edu.wpi.first.wpilibj2.command.Command onTrue, edu.wpi.first.wpilibj2.command.Command onFalse, BooleanSupplier... conditions)
    Combination of RunIf and RunUnless.
  • Method Summary

    Methods inherited from class edu.wpi.first.wpilibj2.command.ConditionalCommand

    end, execute, getInterruptionBehavior, initialize, initSendable, isFinished, runsWhenDisabled

    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, isScheduled, onlyIf, onlyWhile, raceWith, repeatedly, schedule, setName, setSubsystem, unless, until, withDeadline, withInterruptBehavior, withName, withTimeout, withTimeout

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RunIfElse

      public RunIfElse(edu.wpi.first.wpilibj2.command.Command onTrue, edu.wpi.first.wpilibj2.command.Command onFalse, BooleanSupplier... conditions)
      Combination of RunIf and RunUnless.

      Conditions are AND-ed together:

      • onTrue will only run if ALL conditions are true
      • onFalse will run if ANY conditions are false