First phase rumble to prevent robot from entering opponent's Barge#268
First phase rumble to prevent robot from entering opponent's Barge#268neo-Aditya wants to merge 42 commits intomainfrom
Conversation
| this.controller = controller; | ||
| } | ||
|
|
||
| public static boolean isInOppositeBarge(double x, double y) { |
There was a problem hiding this comment.
I would put this in a separate utils class maybe like FieldZoneUtils
| return AllianceColor.equals(Alliance.Blue) ? y : y + 4; | ||
| } | ||
| public double getYFromAlliaceColor() { | ||
| return Robot.getAllianceColor().get().equals(Alliance.Blue) ? y : y + 4; |
There was a problem hiding this comment.
This will throw an error if alliance color is not present
bengold22
left a comment
There was a problem hiding this comment.
There's no actual mapping of this command into RobotContainer
| return AllianceColor.equals(Alliance.Blue) ? y : y + 4; | ||
| } | ||
|
|
||
| public double getYFromAlliaceColor() { |
There was a problem hiding this comment.
wait you can name two methods the same thing as long as you have different constructors that is very cool :)
There was a problem hiding this comment.
Yes, as long as they have different "signatures." A signature is made up of the name of the method and the parameters in the method. So, as long as you have different parameters (or different orders), you can have the same name.
There was a problem hiding this comment.
what about getY(double Y, double X) and getY(double X, double Y) do these count as two different signatures or does it only look at the variable type
| public double getY() { | ||
| return Robot.getAllianceColor().isPresent() | ||
| ? Robot.getAllianceColor().get().equals(Alliance.Blue) ? y : y + 4 | ||
| : y; |
There was a problem hiding this comment.
return -1 if alliance color isn't present
There was a problem hiding this comment.
If this only has one method and only affects one file then don't have it.
|
pull, also, how is this branch so contentious? |
Not Drive Team Approved