countedNames.put(name, order - 1);
}
// name robots
for (int i = battlingRobotsList.length - 1; i >= 0; i--) {
RobotSpecification specification = battlingRobotsList[i];
String name = ((IRobotItem) HiddenAccess.getFileSpecification(specification)).getUniqueFullClassNameWithVersion();
Integer order = countedNames.get(name);
int duplicate = -1;
String newName = name;
if (order > 1) {
duplicate = (order - 2);
newName = name + " (" + (order - 1) + ")";
}
countedNames.put(name, (order - 1));
robotDuplicates.add(0, duplicate);
String teamFullName = HiddenAccess.getRobotTeamName(specification);
if (teamFullName != null) {
List<String> members = teamMembers.get(teamFullName);
members.add(newName);
}
}
// create teams
Map<String, TeamPeer> namedTeams = new HashMap<String, TeamPeer>();
// create robots
for (int i = 0; i < battlingRobotsList.length; i++) {
RobotSpecification specification = battlingRobotsList[i];
TeamPeer team = null;
String teamFullName = HiddenAccess.getRobotTeamName(specification);
// The team index and robot index depends on current sizes of the contestant list and robot list