[commands] Update Subsystem factories and example to return CommandBase (#4729)

Also update rapidreactcommandbot example factories to fit this convention (as in #4655).

C++ does not need an update as CommandPtr already uses CommandBase (#4677).
This commit is contained in:
Ryan Blue
2022-11-28 22:47:18 -05:00
committed by GitHub
parent 70080457d5
commit 21003e34eb
6 changed files with 16 additions and 16 deletions

View File

@@ -85,7 +85,7 @@ public interface Subsystem {
* @return the command
* @see InstantCommand
*/
default Command runOnce(Runnable action) {
default CommandBase runOnce(Runnable action) {
return Commands.runOnce(action, this);
}
@@ -97,7 +97,7 @@ public interface Subsystem {
* @return the command
* @see RunCommand
*/
default Command run(Runnable action) {
default CommandBase run(Runnable action) {
return Commands.run(action, this);
}
@@ -110,7 +110,7 @@ public interface Subsystem {
* @return the command
* @see StartEndCommand
*/
default Command startEnd(Runnable start, Runnable end) {
default CommandBase startEnd(Runnable start, Runnable end) {
return Commands.startEnd(start, end, this);
}
@@ -122,7 +122,7 @@ public interface Subsystem {
* @param end the action to run on interrupt
* @return the command
*/
default Command runEnd(Runnable run, Runnable end) {
default CommandBase runEnd(Runnable run, Runnable end) {
return Commands.runEnd(run, end, this);
}
}