change switch statements in DefaultAutonStrategy to an if else chain
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / commands / auton / DefaultAutonStrategy.java
CommitLineData
6bb7f8ac 1package org.usfirst.frc.team3501.robot.commands.auton;
78d476cc 2
20cb908e 3import org.usfirst.frc.team3501.robot.Constants;
dd794a4e 4import org.usfirst.frc.team3501.robot.Constants.Defense;
6bb7f8ac 5import org.usfirst.frc.team3501.robot.commands.shooter.Shoot;
dd794a4e 6
78d476cc
ME
7import edu.wpi.first.wpilibj.command.CommandGroup;
8
9/**
53d61b3e
ME
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.
78d476cc 12 */
e4f7b3a7 13
d607dcbb 14public class DefaultAutonStrategy extends CommandGroup {
ab237853 15
dd794a4e 16 public DefaultAutonStrategy(int position, Defense defense) {
78d476cc 17
20cb908e 18 if (defense == Constants.Defense.PORTCULLIS)
3c259ed2 19 addSequential(new LiftPortcullis());
ab237853 20
20cb908e 21 else if (defense == Constants.Defense.SALLY_PORT)
86e1c4cc 22 addSequential(new PassSallyPort());
ab237853 23
20cb908e 24 else if (defense == Constants.Defense.ROUGH_TERRAIN)
d607dcbb 25 addSequential(new PassRoughTerrain());
3c259ed2 26
20cb908e 27 else if (defense == Constants.Defense.LOW_BAR)
d607dcbb 28 addSequential(new PassLowBar());
3c259ed2 29
20cb908e 30 else if (defense == Constants.Defense.CHEVAL_DE_FRISE)
af236b4e 31 addSequential(new PassChevalDeFrise());
3c259ed2 32
20cb908e 33 else if (defense == Constants.Defense.DRAWBRIDGE)
227fd1b1 34 addSequential(new PassDrawBridge());
3c259ed2 35
20cb908e 36 else if (defense == Constants.Defense.MOAT)
d607dcbb 37 addSequential(new PassMoat());
3c259ed2 38
20cb908e 39 else if (defense == Constants.Defense.ROCK_WALL)
d607dcbb 40 addSequential(new PassRockWall());
3c259ed2 41
20cb908e 42 else if (defense == Constants.Defense.RAMPART)
d607dcbb 43 addSequential(new PassRampart());
3c259ed2 44
2c0fdbba 45 addSequential(new AimAndAlign());
a697f2ff 46 addSequential(new Shoot());
ab237853 47
53d61b3e
ME
48 }
49
78d476cc 50}