Completed
Push — master ( 74c8db...6c2084 )
by John
33s
created

execute()   A

Complexity

Conditions 5

Size

Total Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 5
c 1
b 0
f 0
dl 0
loc 14
rs 9.2333
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 CyborgCommandRaiseToPosition extends Command {
9
10
    private Mast position;
11
12
    public CyborgCommandRaiseToPosition(Mast position) {
13
        requires(Robot.SUB_MAST);
14
        this.position = position;
15
    }
16
17
    protected boolean isFinished() { return false; }
18
19
    protected void initialize() {}
20
21
    protected void execute() {
22
        switch (position){
23
            case PINION_UP:
24
                Robot.SUB_MAST.adjustPinion(Position.UP);
25
                break;
26
            case PINION_DOWN:
27
                Robot.SUB_MAST.adjustPinion(Position.DOWN);
28
                break;
29
            case SCREW_UP:
30
                Robot.SUB_MAST.adjustScrew(Position.UP);
31
                break;
32
            case SCREW_DOWN:
33
                Robot.SUB_MAST.adjustScrew(Position.DOWN);
34
                break;
35
        }
36
    }
37
38
    protected void end() {}
39
40
    protected void interrupted() {
41
        end();
42
    }
43
}
44