set up the switch statement for the defenses
authorMeryem Esa <meresa14@gmail.com>
Fri, 29 Jan 2016 04:26:38 +0000 (20:26 -0800)
committerKevin Zhang <icestormf1@gmail.com>
Sun, 31 Jan 2016 00:04:37 +0000 (16:04 -0800)
src/org/usfirst/frc/team3501/robot/Constants.java
src/org/usfirst/frc/team3501/robot/commands/DefaultAutonStrategy.java

index 71c4a9a7fc19dbc1b3959eee18344f756c2596ae..deb1285970c600e799bab38c47e17c61dc8d3d40 100644 (file)
@@ -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
   }
 }
index 5eaab4571871a620b165d3d894723a2079a4fe3c..f2b07780e547181399ae0acc558d303c6d55b7eb 100755 (executable)
@@ -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;
+
     }
 
   }