| Total Complexity | 6 |
| Total Lines | 26 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | package org.usfirst.frc.team3695.robot.commands; |
||
| 9 | public class CommandWait extends Command {
|
||
| 10 | |||
| 11 | private long wait; |
||
| 12 | private long startTime; |
||
| 13 | |||
| 14 | public CommandWait(long time) {
|
||
| 15 | this.wait = time; |
||
| 16 | } |
||
| 17 | |||
| 18 | protected void initialize() {
|
||
| 19 | DriverStation.reportWarning("WAITING " + wait + " MILISECONDS", false);
|
||
| 20 | startTime = System.currentTimeMillis(); |
||
| 21 | } |
||
| 22 | |||
| 23 | protected void execute() {}
|
||
| 24 | |||
| 25 | protected boolean isFinished() {
|
||
| 26 | return startTime + wait < System.currentTimeMillis(); |
||
| 27 | } |
||
| 28 | |||
| 29 | protected void end() {
|
||
| 30 | DriverStation.reportWarning("DONE WAITING", false);
|
||
| 31 | } |
||
| 32 | |||
| 33 | protected void interrupted() {
|
||
| 34 | end(); |
||
| 35 | } |
||
| 37 |