2020-12-26 14:12:05 -08:00
|
|
|
// Copyright (c) FIRST and other WPILib contributors.
|
|
|
|
|
// Open Source Software; you can modify and/or share it under the terms of
|
|
|
|
|
// the WPILib BSD license file in the root directory of this project.
|
2019-08-25 23:55:59 -04:00
|
|
|
|
|
|
|
|
#include "frc2/command/ScheduleCommand.h"
|
|
|
|
|
|
|
|
|
|
using namespace frc2;
|
|
|
|
|
|
2022-10-15 16:33:14 -07:00
|
|
|
ScheduleCommand::ScheduleCommand(std::span<Command* const> toSchedule) {
|
2023-08-29 16:16:15 -04:00
|
|
|
for (auto cmd : toSchedule) {
|
|
|
|
|
m_toSchedule.insert(cmd);
|
|
|
|
|
}
|
2019-08-25 23:55:59 -04:00
|
|
|
}
|
|
|
|
|
|
2021-06-06 19:51:14 -07:00
|
|
|
ScheduleCommand::ScheduleCommand(Command* toSchedule) {
|
2023-08-29 16:16:15 -04:00
|
|
|
m_toSchedule.insert(toSchedule);
|
2021-06-06 19:51:14 -07:00
|
|
|
}
|
|
|
|
|
|
2019-08-25 23:55:59 -04:00
|
|
|
void ScheduleCommand::Initialize() {
|
|
|
|
|
for (auto command : m_toSchedule) {
|
|
|
|
|
command->Schedule();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-12-28 12:58:06 -08:00
|
|
|
bool ScheduleCommand::IsFinished() {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2019-08-25 23:55:59 -04:00
|
|
|
|
2020-12-28 12:58:06 -08:00
|
|
|
bool ScheduleCommand::RunsWhenDisabled() const {
|
|
|
|
|
return true;
|
|
|
|
|
}
|