[commands] Subsystem: Add default command removal method (#5064)

This commit is contained in:
Colin Wong
2023-02-24 21:58:53 -06:00
committed by GitHub
parent edf4ded412
commit 4b0eecaee0
3 changed files with 18 additions and 0 deletions

View File

@@ -21,6 +21,10 @@ void Subsystem::SetDefaultCommand(CommandPtr&& defaultCommand) {
std::move(defaultCommand));
}
void Subsystem::RemoveDefaultCommand() {
CommandScheduler::GetInstance().RemoveDefaultCommand(this);
}
Command* Subsystem::GetDefaultCommand() const {
return CommandScheduler::GetInstance().GetDefaultCommand(this);
}

View File

@@ -83,6 +83,12 @@ class Subsystem {
*/
void SetDefaultCommand(CommandPtr&& defaultCommand);
/**
* Removes the default command for the subsystem. This will not cancel the
* default command if it is currently running.
*/
void RemoveDefaultCommand();
/**
* Gets the default command for this subsystem. Returns null if no default
* command is currently associated with the subsystem.