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.
|
2013-12-15 18:30:16 -05:00
|
|
|
|
2018-07-20 00:03:45 -07:00
|
|
|
#include "frc/commands/WaitUntilCommand.h"
|
2016-09-25 16:50:13 -07:00
|
|
|
|
2018-07-20 00:03:45 -07:00
|
|
|
#include "frc/Timer.h"
|
2013-12-15 18:30:16 -05:00
|
|
|
|
2016-11-01 22:33:12 -07:00
|
|
|
using namespace frc;
|
|
|
|
|
|
2021-05-28 22:06:59 -07:00
|
|
|
WaitUntilCommand::WaitUntilCommand(units::second_t time)
|
2015-06-25 15:07:55 -04:00
|
|
|
: Command("WaitUntilCommand", time) {
|
|
|
|
|
m_time = time;
|
2013-12-15 18:30:16 -05:00
|
|
|
}
|
|
|
|
|
|
2021-05-28 22:06:59 -07:00
|
|
|
WaitUntilCommand::WaitUntilCommand(std::string_view name, units::second_t time)
|
2015-06-25 15:07:55 -04:00
|
|
|
: Command(name, time) {
|
|
|
|
|
m_time = time;
|
2013-12-15 18:30:16 -05:00
|
|
|
}
|
|
|
|
|
|
2020-12-28 12:58:06 -08:00
|
|
|
bool WaitUntilCommand::IsFinished() {
|
|
|
|
|
return Timer::GetMatchTime() >= m_time;
|
|
|
|
|
}
|