-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Arreglo interactuables y añado estados
- Loading branch information
Showing
21 changed files
with
172 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,23 @@ | ||
package edu.fiuba.algo3.modelo; | ||
|
||
import edu.fiuba.algo3.modelo.interactuables.InteractuableCasilla; | ||
|
||
import java.util.ArrayList; | ||
|
||
public class Tablero { | ||
private ArrayList<Gladiador> gladiadores; | ||
private Casilla mitadDeMapa; | ||
|
||
/*public Tablero(JSON json){ | ||
// Arma la casilla con el json | ||
Casilla ultima = new Casilla(new Meta()); | ||
Casilla anteultima = new Casilla(ultima, JSON.anteultima); | ||
Casilla primera = new Casilla(anteultima, JSON.primera); | ||
Gladiador primero = new Gladiador(primera); | ||
}*/ | ||
|
||
public Tablero(){ | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package edu.fiuba.algo3.modelo.estados; | ||
|
||
import edu.fiuba.algo3.modelo.Gladiador; | ||
|
||
public interface Estado { | ||
Estado jugar(Gladiador gladiador); | ||
} |
9 changes: 9 additions & 0 deletions
9
src/main/java/edu/fiuba/algo3/modelo/estados/EstadoLesionado.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package edu.fiuba.algo3.modelo.estados; | ||
|
||
import edu.fiuba.algo3.modelo.Gladiador; | ||
|
||
public class EstadoLesionado implements Estado { | ||
public Estado jugar(Gladiador gladiador){ | ||
return new EstadoSano(); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/edu/fiuba/algo3/modelo/estados/EstadoSano.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package edu.fiuba.algo3.modelo.estados; | ||
|
||
import edu.fiuba.algo3.modelo.Gladiador; | ||
|
||
public class EstadoSano implements Estado{ | ||
|
||
public Estado jugar(Gladiador gladiador){ | ||
return gladiador.avanzarCasilla(); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/edu/fiuba/algo3/modelo/estados/EstadoSinEnergia.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package edu.fiuba.algo3.modelo.estados; | ||
|
||
import edu.fiuba.algo3.modelo.Gladiador; | ||
|
||
public class EstadoSinEnergia implements Estado { | ||
@Override | ||
public Estado jugar(Gladiador gladiador) { | ||
gladiador.bonoSinEnergia(); | ||
return new EstadoSano(); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/edu/fiuba/algo3/modelo/interactuables/BacanalInteractuable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package edu.fiuba.algo3.modelo.interactuables; | ||
|
||
import edu.fiuba.algo3.modelo.Dado; | ||
import edu.fiuba.algo3.modelo.Gladiador; | ||
import edu.fiuba.algo3.modelo.estados.Estado; | ||
|
||
public class BacanalInteractuable implements InteractuableCasilla{ | ||
@Override | ||
public Estado interactuar(Gladiador gladiador) { | ||
Dado dado = new Dado(); | ||
return gladiador.beber(dado.tirar()); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/edu/fiuba/algo3/modelo/interactuables/ComidaInteractuable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package edu.fiuba.algo3.modelo.interactuables; | ||
|
||
import edu.fiuba.algo3.modelo.Gladiador; | ||
import edu.fiuba.algo3.modelo.estados.Estado; | ||
import edu.fiuba.algo3.modelo.estados.EstadoSano; | ||
|
||
public class ComidaInteractuable implements InteractuableCasilla { | ||
@Override | ||
public Estado interactuar(Gladiador gladiador) { | ||
gladiador.comer(); | ||
return new EstadoSano(); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/edu/fiuba/algo3/modelo/interactuables/EquipamientoInteractuable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package edu.fiuba.algo3.modelo.interactuables; | ||
|
||
import edu.fiuba.algo3.modelo.Gladiador; | ||
import edu.fiuba.algo3.modelo.estados.Estado; | ||
import edu.fiuba.algo3.modelo.estados.EstadoSano; | ||
|
||
public class EquipamientoInteractuable implements InteractuableCasilla{ | ||
@Override | ||
public Estado interactuar(Gladiador gladiador) { | ||
gladiador.actualizarEquipo(); | ||
return new EstadoSano(); | ||
} | ||
} |
5 changes: 3 additions & 2 deletions
5
src/main/java/edu/fiuba/algo3/modelo/interactuables/FieraInteractuable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
package edu.fiuba.algo3.modelo.interactuables; | ||
|
||
import edu.fiuba.algo3.modelo.Gladiador; | ||
import edu.fiuba.algo3.modelo.estados.Estado; | ||
|
||
public class FieraInteractuable implements InteractuableCasilla{ | ||
@Override | ||
public void interactuar(Gladiador gladiador) { | ||
gladiador.esAtacado(); | ||
public Estado interactuar(Gladiador gladiador) { | ||
return gladiador.esAtacado(); | ||
} | ||
} |
3 changes: 2 additions & 1 deletion
3
src/main/java/edu/fiuba/algo3/modelo/interactuables/InteractuableCasilla.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
package edu.fiuba.algo3.modelo.interactuables; | ||
|
||
import edu.fiuba.algo3.modelo.Gladiador; | ||
import edu.fiuba.algo3.modelo.estados.Estado; | ||
|
||
public interface InteractuableCasilla { | ||
void interactuar (Gladiador gladiador); | ||
Estado interactuar (Gladiador gladiador); | ||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/edu/fiuba/algo3/modelo/interactuables/LesionInteractuable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package edu.fiuba.algo3.modelo.interactuables; | ||
|
||
import edu.fiuba.algo3.modelo.Gladiador; | ||
import edu.fiuba.algo3.modelo.estados.Estado; | ||
import edu.fiuba.algo3.modelo.estados.EstadoLesionado; | ||
|
||
public class LesionInteractuable implements InteractuableCasilla{ | ||
@Override | ||
public Estado interactuar(Gladiador gladiador) { | ||
return new EstadoLesionado(); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/edu/fiuba/algo3/modelo/interactuables/Meta.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package edu.fiuba.algo3.modelo.interactuables; | ||
|
||
import edu.fiuba.algo3.modelo.Gladiador; | ||
import edu.fiuba.algo3.modelo.estados.Estado; | ||
import edu.fiuba.algo3.modelo.estados.EstadoSano; | ||
|
||
public class Meta implements InteractuableCasilla{ | ||
@Override | ||
public Estado interactuar(Gladiador gladiador) { | ||
// Chequea si el gladiador tiene llave | ||
// Sino lo tiene que hacer retroceder la mitad de las casillas | ||
return new EstadoSano(); | ||
} | ||
} | ||
|
6 changes: 4 additions & 2 deletions
6
src/main/java/edu/fiuba/algo3/modelo/interactuables/SinInteraccion.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
package edu.fiuba.algo3.modelo.interactuables; | ||
|
||
import edu.fiuba.algo3.modelo.Gladiador; | ||
import edu.fiuba.algo3.modelo.estados.Estado; | ||
import edu.fiuba.algo3.modelo.estados.EstadoSano; | ||
|
||
public class SinInteraccion implements InteractuableCasilla{ | ||
@Override | ||
public void interactuar(Gladiador gladiador) { | ||
|
||
public Estado interactuar(Gladiador gladiador) { | ||
return new EstadoSano(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters