| Total Complexity | 10 |
| Total Lines | 41 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | package org.usfirst.frc.team3695.robot.commands; |
||
| 8 | public class CyborgCommandGrow extends Command {
|
||
| 9 | |||
| 10 | private Mast position; |
||
| 11 | |||
| 12 | boolean isFinished; |
||
|
|
|||
| 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 | } |
||
| 51 |