Skip to content

Commit

Permalink
Create delegates for not found methods
Browse files Browse the repository at this point in the history
  • Loading branch information
hybras committed Feb 23, 2020
1 parent 7e99743 commit 437d40c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,19 @@ public void initialize(AllianceReport redAlliance, AllianceReport blueAlliance)
Integer.toString(alliance.getTeamReports()[i].getTeamNum()));

setText(color, "team" + numStrNames[i] + "Hatches",
displayDouble(currentTeam.getStatistics().get("totalHatches").getMean()));
displayDouble(currentTeam.getStats().get("totalHatches").getMean()));
setText(color, "team" + numStrNames[i] + "Cargo",
displayDouble(currentTeam.getStatistics().get("totalCargo").getMean()));
displayDouble(currentTeam.getStats().get("totalCargo").getMean()));

// Generate display string for starting position and HAB crossing percentage
var startString = "";
val assignedGamePiece = alliance.getBestSandstormGamePieceCombo().charAt(i);
startString += alliance.getBestStartingLevels()[i] + Character.toString(assignedGamePiece) + " (";

if (assignedGamePiece == 'H') {
startString += (int) Math.round(100 * currentTeam.getStatistics().get("hatchAutoSuccess").getMean());
startString += (int) Math.round(100 * currentTeam.getStats().get("hatchAutoSuccess").getMean());
} else {
startString += (int) Math.round(100 * currentTeam.getStatistics().get("cargoAutoSuccess").getMean());
startString += (int) Math.round(100 * currentTeam.getStats().get("cargoAutoSuccess").getMean());
}
startString += "%)";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ public void generateCalculatedPickAbilityList(ArrayList<TeamReport> knownPartner
potentialAllianceTeams.add(currentTeamReport);

double dysfunctionalPercent =
(double) currentTeamReport.getCounts().get("dysfunctional") / (currentTeamReport.getCounts().get(
(double) currentTeamReport.getCount("dysfunctional") / (currentTeamReport.getCount(
"noShow") + currentTeamReport.getEntries().size());

double pointValue =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ class TeamReport(val teamNum: Int) {
statistics
}

val stats
get() = statistics

/**
* Processes the scout entries within the team report by filtering out no shows, calculating stats, and finding
* abilities and frequent comments
Expand Down Expand Up @@ -190,6 +193,9 @@ class TeamReport(val teamNum: Int) {
}
}

fun getCount(name: String): Int = counts[name] ?: error("No such count")


/**
* Retrieves the value of the specified ability metric
*
Expand Down

0 comments on commit 437d40c

Please sign in to comment.