Skip to content

Commit eedbd42

Browse files
Removal of string checker.
1 parent df05096 commit eedbd42

2 files changed

Lines changed: 15 additions & 7 deletions

File tree

src/main/java/frc/robot/Controls.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
import frc.robot.util.ScoringMode;
4040
import frc.robot.util.SoloScoringMode;
4141
import java.util.function.BooleanSupplier;
42+
import frc.robot.util.ScoringType;
4243

4344
public class Controls {
4445
private static final int SOLO_CONTROLLER_PORT = 0;
@@ -295,7 +296,7 @@ private void configureSuperStructureBindings() {
295296
Commands.deferredProxy(
296297
() ->
297298
switch (scoringMode) {
298-
case CORAL -> getCoralBranchHeightCommand("2C");
299+
case CORAL -> getCoralBranchHeightCommand(ScoringType.DRIVER);
299300
case ALGAE -> Commands.sequence(
300301
superStructure.algaeProcessorScore(
301302
driverController.rightBumper()),
@@ -426,7 +427,7 @@ private void configureSuperStructureBindings() {
426427
() -> {
427428
Command scoreCommand =
428429
switch (scoringMode) {
429-
case CORAL -> getCoralBranchHeightCommand("2C");
430+
case CORAL -> getCoralBranchHeightCommand(ScoringType.DRIVER);
430431
case ALGAE -> Commands.sequence(
431432
BargeAlign.bargeScore(
432433
s.drivebaseSubsystem,
@@ -451,8 +452,8 @@ private Command getAlgaeIntakeCommand() {
451452
};
452453
}
453454

454-
private Command getCoralBranchHeightCommand(String version) {
455-
if (version.equals("SL")) {
455+
private Command getCoralBranchHeightCommand(ScoringType version) {
456+
if (version == ScoringType.SOLOC_LEFT) {
456457
return switch (branchHeight) {
457458
case CORAL_LEVEL_FOUR -> superStructure
458459
.coralLevelFour(soloController.rightBumper())
@@ -472,7 +473,7 @@ private Command getCoralBranchHeightCommand(String version) {
472473
soloController.rightBumper(), () -> AutoAlign.poseInPlace(AutoAlign.AlignType.L1LB))
473474
.andThen(() -> soloScoringMode = soloScoringMode.NO_GAME_PIECE);
474475
};
475-
} else if (version.equals("SR")) {
476+
} else if (version == ScoringType.SOLOC_RIGHT) {
476477
return switch (branchHeight) {
477478
case CORAL_LEVEL_FOUR -> superStructure
478479
.coralLevelFour(soloController.rightBumper())
@@ -954,7 +955,7 @@ private void configureSoloControllerBindings() {
954955
switch (soloScoringMode) {
955956
case CORAL_IN_CLAW -> {
956957
scoreCommand =
957-
getCoralBranchHeightCommand("SL")
958+
getCoralBranchHeightCommand(ScoringType.SOLOC_LEFT)
958959
.until(
959960
() ->
960961
soloController.a().getAsBoolean()
@@ -1010,7 +1011,7 @@ private void configureSoloControllerBindings() {
10101011
() -> {
10111012
Command scoreCommand =
10121013
switch (soloScoringMode) {
1013-
case CORAL_IN_CLAW -> getCoralBranchHeightCommand("SR")
1014+
case CORAL_IN_CLAW -> getCoralBranchHeightCommand(ScoringType.SOLOC_RIGHT)
10141015
.until(
10151016
() ->
10161017
soloController.a().getAsBoolean()
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package frc.robot.util;
2+
3+
public enum ScoringType {
4+
SOLOC_RIGHT,
5+
SOLOC_LEFT,
6+
DRIVER;
7+
}

0 commit comments

Comments
 (0)