mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[commands] Add convenience factories (#4460)
Co-authored-by: Starlight220 <53231611+Starlight220@users.noreply.github.com>
This commit is contained in:
@@ -105,6 +105,11 @@ CommandPtr Command::HandleInterrupt(std::function<void(void)> handler) && {
|
||||
return std::move(*this).ToPtr().HandleInterrupt(std::move(handler));
|
||||
}
|
||||
|
||||
CommandPtr Command::WithName(std::string_view name) && {
|
||||
SetName(name);
|
||||
return std::move(*this).ToPtr();
|
||||
}
|
||||
|
||||
void Command::Schedule() {
|
||||
CommandScheduler::GetInstance().Schedule(this);
|
||||
}
|
||||
@@ -129,6 +134,8 @@ std::string Command::GetName() const {
|
||||
return GetTypeName(*this);
|
||||
}
|
||||
|
||||
void Command::SetName(std::string_view name) {}
|
||||
|
||||
bool Command::IsGrouped() const {
|
||||
return m_isGrouped;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user