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

Semana 1 #2

Merged
merged 31 commits into from
Nov 23, 2023
Merged

Semana 1 #2

merged 31 commits into from
Nov 23, 2023

Conversation

agus-germi
Copy link
Collaborator

Primer PR. Faltan Test09 y Test12.

agus-germi and others added 23 commits November 16, 2023 16:59
Co-authored-by: SebaKrag <skraglievich@fi.uba.ar>
 Co-authored-by: mariagalindez <mgalindez@fi.uba.ar>
 Co-authored-by: SairBaretto <gbaretto@fi.uba.ar>
Co-authored-by: SebaKrag skraglievich@fi.uba.ar
Co-authored-by: SebaKrag <skraglievich@fi.uba.ar>
Co-authored-by: Sebakrag <skraglievich@fi.uba.ar>
Co-authored-by: mariagalindez <mgalindez@fi.uba.ar>
…tests.

Co-authored-by: Sebakrag <skraglievich@fi.uba.ar>
Co-authored-by: mariagalindez <mgalindez@fi.uba.ar>
Co-authored-by: fnpratto <fnpratto@gmail.com>
Co-authored-by: SairBarreto <gbarreto@fi.uba.ar>
Co-authored-by: Sebakrag <sebaskrag@gmail.com>
Co-authored-by: mariagalindez <mgalindez@fi.uba.ar>
Co-authored-by: fnpratto <fnpratto@gmail.com>
Co-authored-by: SairBarreto <gbarreto@fi.uba.ar>
Co-authored-by: agus-germi <agerminario@fi.uba.ar>
Co-authored-by: mariagalindez <mgalindez@fi.uba.ar>
Co-authored-by: agus-germi <agerminario@fi.uba.ar>
Co-authored-by: mariagalindez <mgalindez@fi.uba.ar>
Co-authored-by: SairBarreto <gbarreto@fi.uba.ar>
Co-authored-by: fnpratto <fnpratto@gmail.com>
Co-authored-by: mariagalindez <mgalindez@fi.uba.ar>
Co-authored-by: SairBarreto <gbarreto@fi.uba.ar>
Co-authored-by: Sebakrag <sebaskrag@gmail.com>
Co-authored-by: mariagalindez <mgalindez@fi.uba.ar>
Co-authored-by: SairBarreto <gbarreto@fi.uba.ar>
Co-authored-by: mariagalindez <mgalindez@fi.uba.ar>
Co-authored-by: SairBarreto <gbarreto@fi.uba.ar>
Co-authored-by: mariagalindez <mgalindez@fi.uba.ar>
Co-authored-by: SairBarreto <gbarreto@fi.uba.ar>
Co-authored-by: agus-germi <agerminario@fi.uba.ar>
Co-authored-by: fnpratto <fnpratto@gmail.ar>
…Falta implementar test 09 y 12.

Co-authored-by: mariagalindez <mgalindez@fi.uba.ar>
Co-authored-by: SairBarreto <gbarreto@fi.uba.ar>
Co-authored-by: agus-germi <agerminario@fi.uba.ar>
Co-authored-by: fnpratto <fnpratto@gmail.ar>
Co-authored-by: mariagalindez <mgalindez@fi.uba.ar>
Co-authored-by: mariagalindez <mgalindez@fi.uba.ar>
Co-authored-by: mariagalindez <mgalindez@fi.uba.ar>
Co-authored-by: mariagalindez <mgalindez@fi.uba.ar>
Co-authored-by: fnpratto <fnpratto@gmail.com>
Co-authored-by: Sebakrag <sebaskrag@gmail.com>
@codecov-commenter
Copy link

Welcome to Codecov 🎉

Once merged to your default branch, Codecov will compare your coverage reports and display the results in this comment.

Thanks for integrating Codecov - We've got you covered ☂️

@alejovillores alejovillores added the 📦entrega Etiqueta entrega semanal label Nov 21, 2023
mariagalindez and others added 4 commits November 22, 2023 14:12
Co-authored-by: Sebakrag <sebaskrag@gmail.com>
Co-authored-by: agus-germi <agerminario@fi.uba.ar>
Co-authored-by: SairBarreto <gbarreto@fi.uba.ar>
Co-authored-by: agus-germi <agerminario@fi.uba.ar>
Co-authored-by: Sebakrag <sebaskrag@gmail.com>
Co-authored-by: SairBarreto <gbarreto@fi.uba.ar>
Co-authored-by: mariagalindez <mgalindez@fi.uba.ar>
Co-authored-by: fnpratto <fnpratto@gmail.com>
Co-authored-by: Sebakrag <sebaskrag@gmail.com>
Co-authored-by: mariagalindez <mgalindez@fi.uba.ar>
Co-authored-by: Sebakrag <sebaskrag@gmail.com>
Comment on lines 34 to 36
public void recibirAtaque(){
this.disminuirEnergia(this.equipamiento.recibirAtaque()); //ROMPE ENCAPSULAMIENTO
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Se puede evitar el getter de la siguiente forma

    public void recibirAtaque(){
        this.energia = this.equipamiento.recibirAtaque(this.energia)); 
    }

Copy link
Collaborator

Choose a reason for hiding this comment

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

Genial Ale! Ese código pertenece a Gladiador verdad?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Obvia la pregunta, acabo de ver el path de arriba jajaja

this.disminuirEnergia(this.equipamiento.recibirAtaque()); //ROMPE ENCAPSULAMIENTO
}

public void recibirDanio(int danio) { this.disminuirEnergia(danio); }
Copy link
Collaborator

Choose a reason for hiding this comment

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

Que diferencia hay entre recibirDanio y recibirAtaque si al recibir el ataque se produce un daño?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Tenes toda la razón, es un error que tenemos visto y creemos que encontramos una posible solución. En cuanto comencemos con el refactor va a ser lo primero en arreglar. Gracias por la observación

Copy link
Collaborator

Choose a reason for hiding this comment

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

De hecho, desarrollamos la idea de la solución en un comentario que está al final del archivo de la clase Jugador.java.
Si llegas a leerlo y nos queres anticipar si es un buen planteo y puede llegar a solucionar lo que nos corregiste, nos ayudaría a ahorrar mucho tiempo 🙌🏽

Copy link
Collaborator

@alejovillores alejovillores left a comment

Choose a reason for hiding this comment

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

El decorador le falta una vuelta de rosca incluso por como esta el modelo se puede cambiar por un Strategy .

En la reunion vamos a ver en profundidad los comentarios y como arreglarlos

Comment on lines 51 to 57
private void disminuirEnergia(int energia) {
this.energia -= energia;
}

private void aumentarEnergia(int energia) {
this.energia += energia;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

No les veo mucha utilidad la verdad

public class Jugador {
private Gladiador gladiador;
private int turnos;
private int casillaActual;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Esto debe pasar a ser private Casilla casillaActual;

public Jugador(Gladiador gladiador) {
this.gladiador = gladiador;
this.turnos = 0;
this.casillaActual = 0;
Copy link
Collaborator

Choose a reason for hiding this comment

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

    public Jugador(Gladiador gladiador, Casilla casillaInicial) {
        this.gladiador = gladiador;
        this.turnos = 0;
        this.casillaActual =casillaInicial;

Copy link
Collaborator

@Sebakrag Sebakrag Nov 23, 2023

Choose a reason for hiding this comment

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

En el código más reciente introdujimos este cambio. De alguna manera el código sobre el que hiciste esta corrección quedó es viejo. Me pregunto si habremos hecho mal el push al PR 🤔

Copy link
Collaborator

Choose a reason for hiding this comment

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

Para que se haga un push al PR se tiene que hacer un push en la rama semana-1

Copy link
Collaborator

Choose a reason for hiding this comment

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

Perfecto! Mañana a la mañana lo hacemos entonces. Debemos haberlo hecho a la rama Decorator y no nos dimos cuenta 🫣

Comment on lines 66 to 73
private int tirarDado() {
final int CARAS_DADO = 6;

if (this.gladiador.tieneEnergia()) {
Random random = new Random();
return random.nextInt(CARAS_DADO) + 1;
}
return 0;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Esto tiene que estar encapsulado en una entidad que simule el dado, de manera que se pueda mockear y no depender de una clase que puede violar OC como Random

Comment on lines 62 to 64
private void avanzar(int cantidad) {
this.casillaActual += cantidad;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

La nueva casilla deberia ser obtenida a partir de que la casilla actual conoce a sus vecinos

private static final int CANTIDAD_COPAS_TOTAL = 6;
private static final int ENERGIA_POR_COPA = 4;

private Random random = new Random();
Copy link
Collaborator

Choose a reason for hiding this comment

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

encapsularlo en un objeto Dado o ProvedorRandom, x

Comment on lines 8 to 10
public void afectar(Jugador jugador) {
jugador.mejorarEquipamiento();
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Esta clase debería tener mas responsabilidad, porque sino todos los afectantes simplemente delegan o hacen poquitas cosas

    public void afectar(Jugador jugador) {
        jugador.mejorarEquipamiento(this);
    }

   public Equipamiento mejorarEquipamiento(Casco casco)
   //... asi para los equipamientos//

Comment on lines 3 to 5
public class Lesion {
//el turno siguiente no avanza
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Buscar manera de que haga algo

Comment on lines +17 to +19
public int aumentarEnergia(){
return AUMENTO_ENERGIA;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

    public int aumentarEnergia(int energiaActual){
        return energiaActual + AUMENTO_ENERGIA;
    }

Comment on lines +8 to +10
public Seniority ascender(int turno) {
return this;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

checkear los turnos...

Comment on lines 82 to 89
// public void recibirImpacto(Afectante afectante) {
// this.gladiador.recibirImpacto(afectante);
//}
// Con este metodo reemplazariamos los metodos de:
// mejorarEquipamiento()
// recibirAtaque()
// recibirDanio()
// recibirEnergia()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Me parece mejor.

Comment on lines 100 to 105
// public void recibirImpacto(Lesion lesion) {
// // PROBLEMA con la propuesta de cambio:
// // Aqui el Jugador en el siguiente turno no avanza.
// // Esta logica quizas es conveniente que este en Jugador por el hecho de que un
// // jugador tiene la cantidad de turnos.
// }
Copy link
Collaborator

Choose a reason for hiding this comment

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

Habria que buscar la manera de impedir que el jugador avance

fnpratto and others added 4 commits November 23, 2023 09:05
Co-authored-by: mariagalindez <mgalindez@fi.uba.ar>
Co-authored-by: SairBarreto <gbarreto@fi.uba.ar>
Co-authored-by: agus-germi <agerminario@fi.uba.ar>
Co-authored-by: fnpratto <fnpratto@gmail.com>
Co-authored-by: mariagalindez <mgalindez@fi.uba.ar>
Co-authored-by: fnpratto <fnpratto@gmail.com>
Co-authored-by: Sebakrag <sebaskrag@gmail.com>
Co-authored-by: SairBarreto <gbarreto@fi.uba.ar>
Co-authored-by: mariagalindez <mgalindez@fi.uba.ar>
Co-authored-by: fnpratto <fnpratto@gmail.com>
Co-authored-by: Sebakrag <sebaskrag@gmail.com>
Co-authored-by: SairBarreto <gbarreto@fi.uba.ar>
@alejovillores alejovillores added the ✅aprobado Semana aprobada label Nov 23, 2023
@alejovillores alejovillores merged commit 4baaf3d into master Nov 23, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✅aprobado Semana aprobada 📦entrega Etiqueta entrega semanal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants