isFinished()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 2
c 1
b 0
f 0
rs 10
cc 1
1
package org.usfirst.frc.team3695.robot.commands;
2
3
import edu.wpi.first.wpilibj.DriverStation;
4
import edu.wpi.first.wpilibj.command.Command;
5
6
/**
7
 * Enables and disables the shooter
8
 */
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
    }
36
}
37