diff --git a/src/main/java/edu/fiuba/algo3/modelo/Jugador.java b/src/main/java/edu/fiuba/algo3/modelo/Jugador.java index 372a317a5..13fde8a61 100644 --- a/src/main/java/edu/fiuba/algo3/modelo/Jugador.java +++ b/src/main/java/edu/fiuba/algo3/modelo/Jugador.java @@ -62,9 +62,11 @@ private void avanzar(int cantidad){ } private int tirarDado() { + int CARAS_DADO = 6; + if (this.gladiador.tieneEnergia()) { Random random = new Random(); - return random.nextInt(6) + 1; + return random.nextInt(CARAS_DADO) + 1; } return 0; } diff --git a/src/main/java/edu/fiuba/algo3/modelo/seniorities/Novato.java b/src/main/java/edu/fiuba/algo3/modelo/seniorities/Novato.java index ea98ed177..e5863ac52 100644 --- a/src/main/java/edu/fiuba/algo3/modelo/seniorities/Novato.java +++ b/src/main/java/edu/fiuba/algo3/modelo/seniorities/Novato.java @@ -3,7 +3,7 @@ import edu.fiuba.algo3.modelo.Seniority; public class Novato implements Seniority { - public static final int AUMENTO_ENERGIA = 0; + private static final int AUMENTO_ENERGIA = 0; public Seniority ascender(int turno) { if (turno == 8) { diff --git a/src/main/java/edu/fiuba/algo3/modelo/seniorities/SemiSenior.java b/src/main/java/edu/fiuba/algo3/modelo/seniorities/SemiSenior.java index f69dff487..64f66c14e 100644 --- a/src/main/java/edu/fiuba/algo3/modelo/seniorities/SemiSenior.java +++ b/src/main/java/edu/fiuba/algo3/modelo/seniorities/SemiSenior.java @@ -3,7 +3,7 @@ import edu.fiuba.algo3.modelo.Seniority; public class SemiSenior implements Seniority { - public static final int AUMENTO_ENERGIA = 5; + private static final int AUMENTO_ENERGIA = 5; public Seniority ascender(int turno) { if (turno == 12) { diff --git a/src/main/java/edu/fiuba/algo3/modelo/seniorities/Senior.java b/src/main/java/edu/fiuba/algo3/modelo/seniorities/Senior.java index 10d711b3c..f5fc09977 100644 --- a/src/main/java/edu/fiuba/algo3/modelo/seniorities/Senior.java +++ b/src/main/java/edu/fiuba/algo3/modelo/seniorities/Senior.java @@ -3,7 +3,7 @@ import edu.fiuba.algo3.modelo.Seniority; public class Senior implements Seniority { - public static final int AUMENTO_ENERGIA = 10; + private static final int AUMENTO_ENERGIA = 10; public Seniority ascender(int turno) { return this; diff --git a/src/main/test/edu/fiuba/algo3/entregas/CasosDeUsoSemana1Test.java b/src/main/test/edu/fiuba/algo3/entregas/CasosDeUsoSemana1Test.java index f5d5c366a..605bb837b 100644 --- a/src/main/test/edu/fiuba/algo3/entregas/CasosDeUsoSemana1Test.java +++ b/src/main/test/edu/fiuba/algo3/entregas/CasosDeUsoSemana1Test.java @@ -12,17 +12,20 @@ public class CasosDeUsoSemana1Test { @Test public void test01SeInicializaUnJugadorConLaEnergiaYElEquipamientoCorrecto() { + int energiaInicial = 20; int energiaLuegoDeSerAtacado = 0; Gladiador gladiador = new Gladiador(); Jugador jugador = new Jugador(gladiador); Fiera fiera = new Fiera(); - Assertions.assertTrue(jugador.energiaIgualA(energiaInicial)); + // sigue arrange act y assert. A que costo ? je + boolean jugadorAlCrearseTieneEnergiaInicial = jugador.energiaIgualA(energiaInicial); //Probamos el comportamiento de un Gladiador desequipado (asi se debe instanciar). fiera.afectar(jugador); + Assertions.assertTrue(jugadorAlCrearseTieneEnergiaInicial); Assertions.assertTrue(jugador.energiaIgualA(energiaLuegoDeSerAtacado)); }