Class StatefulCommand
- java.lang.Object
-
- edu.wpi.first.wpilibj2.command.CommandBase
-
- com.lightningrobotics.common.command.core.StatefulCommand
-
- All Implemented Interfaces:
edu.wpi.first.util.sendable.Sendable
,edu.wpi.first.wpilibj2.command.Command
public class StatefulCommand extends edu.wpi.first.wpilibj2.command.CommandBase
A command that iterates through a list of states subclass-defined states.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Runnable
default_action
-
Constructor Summary
Constructors Constructor Description StatefulCommand(java.lang.Enum<?> state)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute()
java.lang.Enum<?>
getCallingState()
java.lang.Enum<?>
getState()
void
initialize()
boolean
isFinished()
protected java.lang.String
methodName(java.lang.Enum<?> state)
protected void
setDefaultAction(java.lang.Runnable action)
void
setState(java.lang.Enum<?> new_state)
-
Methods inherited from class edu.wpi.first.wpilibj2.command.CommandBase
addRequirements, getName, getRequirements, getSubsystem, initSendable, setName, setSubsystem, withName
-
-
-
-
Method Detail
-
setState
public void setState(java.lang.Enum<?> new_state)
-
getState
public java.lang.Enum<?> getState()
-
getCallingState
public java.lang.Enum<?> getCallingState()
-
setDefaultAction
protected void setDefaultAction(java.lang.Runnable action)
-
initialize
public void initialize()
-
isFinished
public boolean isFinished()
-
methodName
protected java.lang.String methodName(java.lang.Enum<?> state)
-
execute
public void execute()
-
-