From: Meryem Esa Date: Fri, 29 Jan 2016 04:26:38 +0000 (-0800) Subject: set up the switch statement for the defenses X-Git-Url: http://challenge-bot.com/repos/?p=3501%2Fstronghold-2016;a=commitdiff_plain;h=dd794a4e6639d514430173497f0cce20f140ce02 set up the switch statement for the defenses --- diff --git a/src/org/usfirst/frc/team3501/robot/Constants.java b/src/org/usfirst/frc/team3501/robot/Constants.java index 71c4a9a7..deb12859 100644 --- a/src/org/usfirst/frc/team3501/robot/Constants.java +++ b/src/org/usfirst/frc/team3501/robot/Constants.java @@ -54,7 +54,7 @@ public class Constants { LEFT, RIGHT, DOWN, UP, FORWARD, BACKWARD; } - enum Defense { - PORTCULLIS, SALLY_PORT, ROUGH_TERRAIN, LOW_BAR, CHEVAL_DE_FRISE, DRAWBRIDGE, MOAT, ROCK_WALL + public enum Defense { + PORTCULLIS, SALLY_PORT, ROUGH_TERRAIN, LOW_BAR, CHEVAL_DE_FRISE, DRAWBRIDGE, MOAT, ROCK_WALL, RAMPART } } diff --git a/src/org/usfirst/frc/team3501/robot/commands/DefaultAutonStrategy.java b/src/org/usfirst/frc/team3501/robot/commands/DefaultAutonStrategy.java index 5eaab457..f2b07780 100755 --- a/src/org/usfirst/frc/team3501/robot/commands/DefaultAutonStrategy.java +++ b/src/org/usfirst/frc/team3501/robot/commands/DefaultAutonStrategy.java @@ -1,5 +1,7 @@ package org.usfirst.frc.team3501.robot.commands; +import org.usfirst.frc.team3501.robot.Constants.Defense; + import edu.wpi.first.wpilibj.command.CommandGroup; /** @@ -8,7 +10,7 @@ import edu.wpi.first.wpilibj.command.CommandGroup; */ public class DefaultAutonStrategy extends CommandGroup { - public DefaultAutonStrategy(int position, int defense) { + public DefaultAutonStrategy(int position, Defense defense) { /* * pass defense drive forward do what has to be done to pass the defense * drive forward aim face tower aim shooter toward goal shoot @@ -16,11 +18,18 @@ public class DefaultAutonStrategy extends CommandGroup { // based on defense pass the defense switch (defense) { - case 1: - case 2: - case 3: - case 4: - case 5: + case PORTCULLIS: + case SALLY_PORT: + case ROUGH_TERRAIN: + case LOW_BAR: + case CHEVAL_DE_FRISE: + case DRAWBRIDGE: + case MOAT: + case ROCK_WALL: + case RAMPART: + default: + break; + } }