public AlignToScore(int position) {
- switch (position) {
+ if (position == 1) {
- // position 1 is always the low bar
- case 1:
+ // position 1 is always the low bar
addSequential(new DriveForDistance(POS1_DIST1, DEFAULT_SPEED));
addSequential(new TurnForAngle(POS1_TURN1));
addSequential(new DriveForDistance(POS1_DIST2, DEFAULT_SPEED));
horizontalDistToGoal = 0;
-
- case 2:
+ } else if (position == 2) {
addSequential(new DriveForDistance(POS2_DIST1, DEFAULT_SPEED));
addSequential(new TurnForAngle(POS2_TURN1));
addSequential(new DriveForDistance(POS2_DIST2, DEFAULT_SPEED));
horizontalDistToGoal = 0;
- case 3:
+ } else if (position == 3) {
addSequential(new DriveForDistance(POS3_DIST1, DEFAULT_SPEED));
addSequential(new TurnForAngle(POS3_TURN1));
addSequential(new DriveForDistance(POS3_DIST3, DEFAULT_SPEED));
horizontalDistToGoal = 0;
- case 4:
+ } else if (position == 4) {
addSequential(new DriveForDistance(POS4_DIST1, DEFAULT_SPEED));
addSequential(new TurnForAngle(POS4_TURN1));
addSequential(new DriveForDistance(POS4_DIST3, DEFAULT_SPEED));
horizontalDistToGoal = 0;
- case 5:
+ } else if (position == 5) {
addSequential(new DriveForDistance(POS5_DIST1, DEFAULT_SPEED));
addSequential(new TurnForAngle(POS5_TURN1));