Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Entrega4 #5

Merged
merged 42 commits into from
Sep 1, 2021
Merged

Entrega4 #5

merged 42 commits into from
Sep 1, 2021

Conversation

juanireil
Copy link
Owner

No description provided.

@juanireil juanireil requested a review from edjus August 3, 2021 23:58
Comment on lines +29 to +30
// juego.jugar();
// this.vista.mostrarInterfazColocacion(juego, juego.obtenerJugadorActual(), juego.obtenerSiguienteJugador(), juego.obtenerJugadorJugando().color(), juego.cantidadEjercitosDisponibles());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eliminar código comentado

Comment on lines +24 to +32
@Override
public void AtacarCon(Jugador jugadorActual, Pais atacante, Pais defensor) {

}

@Override
public void transferirEjercitos(Jugador jugadorActual, Pais aliado1, Pais aliado2, int cantidadEjercitos) {

}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hay varios mensajes que no hacen nada, es por que la interfaz "obliga" a que tenga esos métodos, síntoma de una violación al principio de segregación de interfaces. La solución es dividir la interface grande y usarlo según necesidad (se puede implementar más de una interfaz)

Comment on lines +90 to +115
if (this.jugador == null) return;

for (String c : this.continentesAOcupar) {
if (obj1)
obj1 = (juego.obtenerTablero().obtenerCantidadPaisesDeContinente(c) ==
juego.obtenerTablero().obtenerCantidadPaisesJugadorEnContinente(this.jugador, c));
}

for (Map.Entry<String, Integer> entry : continentesYCantidades.entrySet()) {
String continente = entry.getKey();
Integer cantidad = entry.getValue();
if (obj2)
obj2 = (cantidad <= juego.obtenerTablero().obtenerCantidadPaisesJugadorEnContinente(this.jugador, continente));
}

if (this.limitrofes > 0){
for (Pais unPais : juego.obtenerTablero().obtenerPaises()) {
if (unPais.perteneceA(this.jugador)){
int cantidadLimitrofesOcupados = 0;
for (Pais otroPais : unPais.obtenerLimitrofes() ) {
if (otroPais.perteneceA(this.jugador)) cantidadLimitrofesOcupados++;
}
if (obj3) obj3 = cantidadLimitrofesOcupados >= this.limitrofes;
}
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quedó algo dificl de leer el código, se podría usar exract method para hacer el código más legible

Copy link
Collaborator

@edjus edjus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dejo un par de comentarios de mejora.

@juanireil juanireil merged commit 199b47b into master Sep 1, 2021
@juanireil juanireil deleted the entrega4 branch September 1, 2021 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants