Refactorizando visibilidad transacciones

This commit is contained in:
2019-11-11 22:36:33 +01:00
parent 95805c3efa
commit e9a85d3df0
4 changed files with 11 additions and 19 deletions

View File

@@ -30,16 +30,13 @@ public class Gestion{
return this.gestiones;
}
public void alterarVisibilidad(boolean visibilidad, int elemento) {
if(this.gestiones.get(elemento).alterarVisivilidad(visibilidad)) {
if(this.gestiones.get(elemento).getVisivilidad()) {
this.suma+=this.gestiones.get(elemento).getDinero();
Gestion.total+=this.gestiones.get(elemento).getDinero();
}else {
this.suma-=this.gestiones.get(elemento).getDinero();
Gestion.total-=this.gestiones.get(elemento).getDinero();
}
public void alterarVisibilidad(int elemento) {
if(this.gestiones.get(elemento).alterarVisivilidad()) {
this.suma+=this.gestiones.get(elemento).getDinero();
Gestion.total+=this.gestiones.get(elemento).getDinero();
}else {
this.suma-=this.gestiones.get(elemento).getDinero();
Gestion.total-=this.gestiones.get(elemento).getDinero();
}
}