001/*----------------------------------------------------------------------------*/
002/* Copyright (c) 2008-2018 FIRST. All Rights Reserved.                        */
003/* Open Source Software - may be modified and shared by FRC teams. The code   */
004/* must be accompanied by the FIRST BSD license file in the root directory of */
005/* the project.                                                               */
006/*----------------------------------------------------------------------------*/
007
008package edu.wpi.first.wpilibj.command;
009
010import edu.wpi.first.wpilibj.Timer;
011
012/**
013 * WaitUntilCommand - waits until an absolute game time. This will wait until the game clock reaches
014 * some value, then continue to the next command.
015 */
016public class WaitUntilCommand extends Command {
017  private double m_time;
018
019  public WaitUntilCommand(double time) {
020    super("WaitUntil(" + time + ")");
021    m_time = time;
022  }
023
024  /**
025   * Check if we've reached the actual finish time.
026   */
027  public boolean isFinished() {
028    return Timer.getMatchTime() >= m_time;
029  }
030}