Skip to content

Commit

Permalink
Resolve "Add Integration Test checking for KickOff Situation"
Browse files Browse the repository at this point in the history
Closes #1961

See merge request main/Sumatra!1838

sumatra-commit: be484e6acc8b4edf78321eb477422b3702393fdd
  • Loading branch information
g3force authored and TIGERs GitLab committed May 22, 2024
1 parent beb984d commit e3debf7
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
27 changes: 26 additions & 1 deletion modules/common/src/main/java/edu/tigers/sumatra/ids/EAiTeam.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public enum EAiTeam

;

private ETeamColor teamColor;
private final ETeamColor teamColor;


/**
Expand Down Expand Up @@ -53,4 +53,29 @@ public boolean matchesColor(ETeamColor color)
{
return color == teamColor;
}


/**
* @param color
* @return
*/
public static EAiTeam opposite(final EAiTeam color)
{
return switch (color)
{
case YELLOW -> BLUE;
case BLUE -> YELLOW;
};
}


/**
* @return
*/
public EAiTeam opposite()
{
return opposite(this);
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,14 @@ public boolean hadContactFromVision(double horizon)
{
return (current - visionEnd) * 1e-9 < horizon;
}


/**
* @return true, if the ball had contact within the last 0.2 seconds
*/
public boolean hadRecentContactFromVision()
{
return hadContactFromVision(recentContactHorizon);
}

}

0 comments on commit e3debf7

Please sign in to comment.