Test Failed
Push — master ( 08f71e...df8093 )
by John
02:02
created

end()   A

Complexity

Conditions 1

Size

Total Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
package org.usfirst.frc.team3695.robot.commands;
2
3
import edu.wpi.first.wpilibj.command.Command;
4
import org.usfirst.frc.team3695.robot.Robot;
5
import org.usfirst.frc.team3695.robot.enumeration.Mast;
6
import org.usfirst.frc.team3695.robot.enumeration.Position;
7
8
public class CyborgCommandGrow extends Command {
9
10
    private Mast position;
11
12
    boolean isFinished;
0 ignored issues
show
Comprehensibility introduced by
Fields and methods should not have conflicting names like isFinished. While this is technically legal it can lead to misunderstandings and problems with serialization.
Loading history...
13
    public CyborgCommandGrow(Mast position) {
14
        requires(Robot.SUB_MAST);
15
        this.position = position;
16
        isFinished = false;
17
    }
18
19
    protected boolean isFinished() {
20
        return isFinished;
21
    }
22
23
    protected void initialize() {
24
        switch (position) {
25
            case PINION_UP:
26
                Robot.SUB_MAST.adjustPinion(Position.UP);
27
                break;
28
            case PINION_DOWN:
29
                Robot.SUB_MAST.adjustPinion(Position.DOWN);
30
                break;
31
            case SCREW_UP:
32
                Robot.SUB_MAST.adjustScrew(Position.UP);
33
                break;
34
            case SCREW_DOWN:
35
                Robot.SUB_MAST.adjustScrew(Position.DOWN);
36
                break;
37
        }
38
        isFinished = true;
39
    }
40
41
    protected void execute() {}
42
43
    protected void end() {
44
        isFinished = false;
45
    }
46
47
    protected void interrupted() {
48
        end();
49
    }
50
}
51