Skip to content

Commit

Permalink
Agregado un excel para que veamos todos, issue #3
Browse files Browse the repository at this point in the history
  • Loading branch information
igna-angel committed Dec 3, 2015
1 parent cb8adb6 commit 85b655a
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 36 deletions.
Binary file added Probabilidad de ganar el truco.xlsx
Binary file not shown.
Binary file modified Truco/bin/com/modelo/JugadorVirtual.class
Binary file not shown.
43 changes: 7 additions & 36 deletions Truco/src/com/modelo/JugadorVirtual.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.modelo.acciones.flor.AccionFlor;
import com.modelo.acciones.flor.ContraFlor;
import com.modelo.acciones.flor.ContraFlorAlResto;
import com.modelo.acciones.flor.FlorNoQuiero;
import com.modelo.acciones.flor.FlorQuiero;
import com.modelo.acciones.truco.AccionTruco;
import com.modelo.acciones.truco.NoQuiero;
Expand Down Expand Up @@ -87,46 +88,11 @@ public Accion responderA(AccionTruco accion, ManejadorDeRonda manejadorDeRonda,P

public Accion responderA(ReTruco accion, ManejadorDeRonda manejadorDeRonda,Partido partido) {
return new Quiero(accion);
/*System.out.print("Quiere ReTruco: ");
Scanner scan = new Scanner(System.in);
String respuesta = scan.next().toLowerCase();
scan.close();
if (respuesta.equals("quiero")){
return new Quiero(accion);
} else
if (respuesta.equals("noquiero")){
return new NoQuiero(accion);
} else
if (respuesta.equals(("valecuatro"))){
return manejadorDeRonda.cantarValeCuatro(new ValeCuatro(accion));

} else {
throw new AccionNoPosibleException();
}*/
}

public Accion responderA(ValeCuatro accion) {
return new Quiero(accion);
/*System.out.print("Quiere ValeCuatro: ");
Scanner scan = new Scanner(System.in);
String respuesta = scan.next().toLowerCase();
scan.close();
if (respuesta.equals("quiero")){
return new Quiero(accion);
} else
if (respuesta.equals("noquiero")){
return new NoQuiero(accion);
} else {
throw new AccionNoPosibleException();
}*/
}

public Accion responderA(Envido accion, ManejadorDeRonda manejadorDeRonda, Partido partido) {
Expand Down Expand Up @@ -181,7 +147,12 @@ public Accion responderA(FaltaEnvido accion) {

public Accion responderA(AccionFlor accion, ManejadorDeRonda manejadorDeRonda, Partido partido) {
// Para hacerlo básico, la flor la queremos siempre (solo querer)
return new FlorQuiero(accion);
if (this._mano.florEnMano()) {
return new FlorQuiero(accion);
}

return new FlorNoQuiero(accion);

}


Expand Down
26 changes: 26 additions & 0 deletions Truco/src/com/modelo/acciones/flor/FlorNoQuiero.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.modelo.acciones.flor;

public class FlorNoQuiero extends FlorDecorator{

public FlorNoQuiero(AccionFlor accionDecorar) {
super(accionDecorar);
}

public int cantar(){
if (esFlorComun()){
return super.cantar() - 2;
} else if (esContraFlor()){
return super.cantar() - 2;
} else { // ContraFlor al Resto
return super.cantar() - 29;
}
}

private boolean esFlorComun(){
return super.cantar() == 3;
}

private boolean esContraFlor(){
return super.cantar() == 6;
}
}

0 comments on commit 85b655a

Please sign in to comment.