-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
14 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,25 @@ | ||
package frc.robot.subsystems; | ||
|
||
public interface SystemState { | ||
/** | ||
* Initial action of state. Called once when state is initially scheduled | ||
*/ | ||
public default void initialize() {} | ||
|
||
/** | ||
* Main body of state. Called repeatedly when state is scheduled. | ||
*/ | ||
public default void execute() {} | ||
|
||
/** | ||
* The action to take when the state ends. Called when either the state finishes normally, or when it interrupted/canceled. | ||
* @param interrupted Whether the state was interrupted or cancelled | ||
*/ | ||
public default void end(boolean interrupted) {} | ||
|
||
/** | ||
* Get next state based on variety of inputs. Also used to know if current state is complete. | ||
* @return Next state | ||
*/ | ||
public SystemState nextState(); | ||
} |