001/*----------------------------------------------------------------------------*/
002/* Copyright (c) FIRST 2008-2017. 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
018  private double m_time;
019
020  public WaitUntilCommand(double time) {
021    super("WaitUntil(" + time + ")");
022    m_time = time;
023  }
024
025  /**
026   * Check if we've reached the actual finish time.
027   */
028  public boolean isFinished() {
029    return Timer.getMatchTime() >= m_time;
030  }
031}