-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
tests Objetivo (NO TERMINADO)
// juego.jugar(); | ||
// this.vista.mostrarInterfazColocacion(juego, juego.obtenerJugadorActual(), juego.obtenerSiguienteJugador(), juego.obtenerJugadorJugando().color(), juego.cantidadEjercitosDisponibles()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eliminar código comentado
@Override | ||
public void AtacarCon(Jugador jugadorActual, Pais atacante, Pais defensor) { | ||
|
||
} | ||
|
||
@Override | ||
public void transferirEjercitos(Jugador jugadorActual, Pais aliado1, Pais aliado2, int cantidadEjercitos) { | ||
|
||
} |
There was a problem hiding this comment.
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)
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; | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
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
There was a problem hiding this 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.
No description provided.