[commands] Add C++ Requirements struct (#5504)

This commit is contained in:
Joseph Eng
2023-09-17 20:48:39 -07:00
committed by GitHub
parent b265a68eea
commit 633c5a8a22
43 changed files with 273 additions and 1112 deletions

View File

@@ -8,14 +8,7 @@ using namespace frc2;
NotifierCommand::NotifierCommand(std::function<void()> toRun,
units::second_t period,
std::initializer_list<Subsystem*> requirements)
: m_toRun(toRun), m_notifier{std::move(toRun)}, m_period{period} {
AddRequirements(requirements);
}
NotifierCommand::NotifierCommand(std::function<void()> toRun,
units::second_t period,
std::span<Subsystem* const> requirements)
Requirements requirements)
: m_toRun(toRun), m_notifier{std::move(toRun)}, m_period{period} {
AddRequirements(requirements);
}