Skip to content

Commit

Permalink
Ataque de bot estrategico no funciona bien
Browse files Browse the repository at this point in the history
  • Loading branch information
ander authored and ander committed May 14, 2023
1 parent dd3ead6 commit b3cb1ac
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/Modelo/Bot.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public void setTurno(boolean pTurno) {
//System.out.println("Ha cambiado el turno a" + pTurno);
if (this.turno) {
//ataquedeBot();
ataquedeBotInteligente();
ataquedeBot();
// atacarBot elige atacante aleatorio que no sea this
ListaJugadores.getListaJugadores().asignarTurnoAleatoriamente();

Expand Down Expand Up @@ -61,7 +61,7 @@ private void ataquedeBot(){
}
}

private void ataquedeBotInteligente(){
/*private void ataquedeBotInteligente(){
ArrayList<String> tipos = (ArrayList<String>) (this.getListaPok().stream().map(p -> p.getTipo()).collect(Collectors.toList()));
int idJug = ListaJugadores.getListaJugadores().pokemonEfectivo(tipos);
System.out.println("Soy el jugador: " + this.getId());
Expand All @@ -80,6 +80,6 @@ private void ataquedeBotInteligente(){
}
CampoDeBatalla.getCampoBatalla().eliminarBatalla();
}
}
}*/
}
}
6 changes: 3 additions & 3 deletions src/Modelo/Jugador.java
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public int tamainoLista () {
return lPokemon.size();
}

public int numPokEfectivos (ArrayList<String> tipos) {
/*public int numPokEfectivos (ArrayList<String> tipos) {
int num = 0;
for (String t: tipos) {
for (Pokemon p: lPokemon) {
Expand All @@ -155,8 +155,8 @@ public int numPokEfectivos (ArrayList<String> tipos) {
}
}
return num;
}

}*/
//Mejor public HashMap<String,Integer> que por cada tipo guarde el id de todos los Pokemon que son efectivos
protected ArrayList<Pokemon> getListaPok(){
return this.lPokemon;
}
Expand Down
5 changes: 3 additions & 2 deletions src/Modelo/ListaJugadores.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public int tamainoLista() {
return lJugadores.size();
}

public int pokemonEfectivo(ArrayList<String> tipos){ /*Mejor hacerlo con Java8*/
/*public int pokemonEfectivo(ArrayList<String> tipos){
int max = 0;
int idMax = 0;
int num = 0;
Expand All @@ -150,5 +150,6 @@ public int pokemonEfectivo(ArrayList<String> tipos){ /*Mejor hacerlo con Java8*/
}
}
return idMax;
}
}*/
// Mejor devolver un HashMap<Integer,HashMap<String,Integer>> y que por cada jugador devuelva un HashMap<String,Integer>
}

0 comments on commit b3cb1ac

Please sign in to comment.