change switch statements in DefaultAutonStrategy to an if else chain
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / commands / auton / DefaultAutonStrategy.java
1 package org.usfirst.frc.team3501.robot.commands.auton;
2
3 import org.usfirst.frc.team3501.robot.Constants;
4 import org.usfirst.frc.team3501.robot.Constants.Defense;
5 import org.usfirst.frc.team3501.robot.commands.shooter.Shoot;
6
7 import edu.wpi.first.wpilibj.command.CommandGroup;
8
9 /**
10 * The default autonomous strategy involves passing the defense that is in front
11 * of it, aiming the robot/ shooter towards the goal, and shooting.
12 */
13
14 public class DefaultAutonStrategy extends CommandGroup {
15
16 public DefaultAutonStrategy(int position, Defense defense) {
17
18 if (defense == Constants.Defense.PORTCULLIS)
19 addSequential(new LiftPortcullis());
20
21 else if (defense == Constants.Defense.SALLY_PORT)
22 addSequential(new PassSallyPort());
23
24 else if (defense == Constants.Defense.ROUGH_TERRAIN)
25 addSequential(new PassRoughTerrain());
26
27 else if (defense == Constants.Defense.LOW_BAR)
28 addSequential(new PassLowBar());
29
30 else if (defense == Constants.Defense.CHEVAL_DE_FRISE)
31 addSequential(new PassChevalDeFrise());
32
33 else if (defense == Constants.Defense.DRAWBRIDGE)
34 addSequential(new PassDrawBridge());
35
36 else if (defense == Constants.Defense.MOAT)
37 addSequential(new PassMoat());
38
39 else if (defense == Constants.Defense.ROCK_WALL)
40 addSequential(new PassRockWall());
41
42 else if (defense == Constants.Defense.RAMPART)
43 addSequential(new PassRampart());
44
45 addSequential(new AimAndAlign());
46 addSequential(new Shoot());
47
48 }
49
50 }