Conversation
| for (Goal currGame : this.getGoals()) { | ||
| if (currGame.getTheTeam() == homeTeam) { | ||
| homeTeamGoals++; | ||
|
|
There was a problem hiding this comment.
eliminar espacio innecesario
| } | ||
|
|
||
| public void showBestTeam(Team[] theTeams) { | ||
|
|
There was a problem hiding this comment.
eliminar espacio innecesario
| } | ||
|
|
||
| public void incPointsTotal(int pointsTotal) { | ||
|
|
There was a problem hiding this comment.
eliminar espacio innecesario
| Goal goals = new Goal(); | ||
| int numberOfTeam = (int) (Math.random() * 2); | ||
| if (numberOfTeam != 0) { | ||
|
|
There was a problem hiding this comment.
eliminar espacio innecesario
| goals.setTheTime((int) (Math.random() * 90)); | ||
|
|
||
| } else { | ||
|
|
There was a problem hiding this comment.
eliminar espacio innecesario
| int homeTeamGoals = 0; | ||
| int awayTeamGoals = 0; | ||
| StringBuilder returnString = new StringBuilder(); | ||
|
|
There was a problem hiding this comment.
eliminar espacio innecesario
| if (currGame.getTheTeam() == homeTeam) { | ||
| homeTeamGoals++; | ||
| homeTeam.incGoalsTotal(1); | ||
|
|
There was a problem hiding this comment.
eliminar espacio innecesario
| awayTeam.incGoalsTotal(1); | ||
| } | ||
| returnString.append("Goal scored after " | ||
| + currGame.getTheTime() + " mins by " |
There was a problem hiding this comment.
la recomendación aquí es que el símbolo + quede al final de la linea previa no en la siguiente:
returnString.append("Goal scored after " +
currGame.getTheTime() + " mins by "
| } | ||
|
|
||
| public void showBestTeam(Team[] theTeams) { | ||
|
|
There was a problem hiding this comment.
eliminar espacio innecesario
| public class GameUtils { | ||
|
|
||
| public static Game addGamesGoals(Game currGame) { | ||
|
|
There was a problem hiding this comment.
eliminar espacio innecesario
| Goal goals = new Goal(); | ||
| int numberOfTeam = (int) (Math.random() * 2); | ||
| if (numberOfTeam != 0) { | ||
|
|
There was a problem hiding this comment.
eliminar espacio innecesario
| } | ||
|
|
||
| public String getDescription() { | ||
|
|
There was a problem hiding this comment.
eliminar espacio innecesario
| this.localDateTime.format(DateTimeFormatter.ISO_LOCAL_DATE)+ "\n"); | ||
|
|
||
| for (Goal currGoal: this.getGoals()) { | ||
|
|
There was a problem hiding this comment.
eliminar espacio innecesario
| * @param args the command line arguments | ||
| */ | ||
| public static void main(String[] args) { | ||
|
|
There was a problem hiding this comment.
eliminar espacio innecesario
| } | ||
|
|
||
| public Team[] createTeams(String teamName, int teamSize) { | ||
|
|
There was a problem hiding this comment.
eliminar espacio innecesario
| currBestTeam = currTeam.getPointsTotal() > | ||
| currBestTeam.getPointsTotal() ? currTeam : currBestTeam; | ||
| if (currTeam.getPointsTotal() > currBestTeam.getPointsTotal()) | ||
| { |
There was a problem hiding this comment.
este formato de if es mas apropiado para C, la recomendación es hacerlo como sigue:
if (condicion) {
bloque de codigo
}
| { | ||
| currBestTeam = currTeam; | ||
| } else if (currTeam.getPointsTotal() == currBestTeam.getPointsTotal()) | ||
| { |
| public String getLeagueAnnouncement(Game[] theGames){ | ||
| Period thePeriod=Period.between(theGames[0].getLocalDateTime().toLocalDate(), | ||
| theGames[theGames.length-1].getLocalDateTime().toLocalDate()); | ||
| return "The league is Scheduled to run for "+ thePeriod.getMonths() + |
There was a problem hiding this comment.
identar el código de manera correcta
|
|
||
| public static void addGameGoals(Game currGame) { | ||
|
|
||
| //System.out.println(currGame.awayTeam + " : " + currGame.homeTeam); |
| currGame.setGoals(new Goal[(int) (Math.random() * 10)]); // If goals not initialized max will be 9 | ||
| } | ||
|
|
||
| //System.out.println(currGame.goals.length); |
| for (Goal currGoal : currGame.getGoals()) { | ||
| currGoal = new Goal(); | ||
| currGoal.setTheTeam(Math.random() > 0.5 ? currGame.getHomeTeam() : currGame.getAwayTeam()); | ||
| currGoal.setThePlayer(currGoal.getTheTeam().getPlayerArray()[(int) (Math.random() * currGoal.getTheTeam().getPlayerArray().length)]); |
There was a problem hiding this comment.
ejecutar el reporte de maven para verificar que todas las reglas que se configuraron están pasando. En caso de que no hacer los ajustes
| players = new ArrayList(); | ||
| while (authorToken.hasMoreElements()) { | ||
| players.add(new Player((String) authorToken.nextElement())); | ||
|
|
There was a problem hiding this comment.
eliminar espacio innecesario
|
|
||
| Player[] teamsPlayer=new Player[numberOfPlayers]; | ||
|
|
||
| for (int i = 0; i < numberOfPlayers; i++) { |
There was a problem hiding this comment.
ajustar la identacion de las lineas
|
|
||
| return teamsPlayer; | ||
| } | ||
| String authorList |
There was a problem hiding this comment.
colocar las variables al principio, no al final de una clase
| ArrayList <Goal> eventList = new ArrayList(); | ||
| Goal currEvent; | ||
| for (int i = 1; i <= 90; i++) { | ||
|
|
There was a problem hiding this comment.
eliminar espacio innecesario
|
Hay varios detalles por ajustar en el código. Principalmente observe los siguientes:
|
Se entregan las las practicas 11, 12, 13 y 14 del material OCA