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;
|
|
|
|
|
|
2015-06-25 15:07:55 -04:00
|
|
|
WaitUntilCommand::WaitUntilCommand(double time)
|
|
|
|
|
: Command("WaitUntilCommand", time) {
|
|
|
|
|
m_time = time;
|
2013-12-15 18:30:16 -05:00
|
|
|
}
|
|
|
|
|
|
2018-04-29 23:33:19 -07:00
|
|
|
WaitUntilCommand::WaitUntilCommand(const wpi::Twine& name, double time)
|
2015-06-25 15:07:55 -04:00
|
|
|
: Command(name, time) {
|
|
|
|
|
m_time = time;
|
2013-12-15 18:30:16 -05:00
|
|
|
}
|
|
|
|
|
|
2015-06-25 15:07:55 -04:00
|
|
|
bool WaitUntilCommand::IsFinished() { return Timer::GetMatchTime() >= m_time; }
|