[commands] Add Subsystem.idle() (#7815)

This commit is contained in:
Wispy
2025-08-31 00:54:53 -05:00
committed by GitHub
parent 129cbbe11d
commit 2cfd58f119
3 changed files with 22 additions and 0 deletions

View File

@@ -46,6 +46,10 @@ void Subsystem::Register() {
return CommandScheduler::GetInstance().RegisterSubsystem(this);
}
CommandPtr Subsystem::Idle() {
return cmd::Idle({this});
}
CommandPtr Subsystem::RunOnce(std::function<void()> action) {
return cmd::RunOnce(std::move(action), {this});
}

View File

@@ -121,6 +121,15 @@ class Subsystem {
*/
void Register();
/**
* Constructs a command that does nothing until interrupted. Requires this
* subsystem.
*
* @return the command
*/
[[nodiscard]]
CommandPtr Idle();
/**
* Constructs a command that runs an action once and finishes. Requires this
* subsystem.