Les clics sur les cases marche, c'est incroyable

main
Allan POINT 3 years ago
parent dd279c0724
commit 6c03d93d86

@ -128,6 +128,10 @@ public class Manager implements ObserverBDJ {
return actualiseurCellule.getArbitre().getPlateau().getColone(); return actualiseurCellule.getArbitre().getPlateau().getColone();
} }
public Cellule getCell(int x, int y){
return actualiseurCellule.getArbitre().getPlateau().getCell(x, y);
}
public void setCellsColor(int color){ public void setCellsColor(int color){
Cellule.setLivingColor(color); Cellule.setLivingColor(color);
} }

@ -110,8 +110,8 @@ public class PlateauView extends View implements ObserverCV {
} }
} }
public void addPosCell(int x, int y){ public void addPosCell(Cellule cellule){
//TODO: Récup la céllue et ajouter dans colors colors.put(cellule.getPosition(), cellule.getActiveColor());
} }
public void setColones(int value) throws IllegalArgumentException{ public void setColones(int value) throws IllegalArgumentException{

@ -54,7 +54,7 @@ public class FragmentPlateau extends Fragment {
Log.d("D", "y=" + y); Log.d("D", "y=" + y);
try { try {
manager.updateOnCellBeforeStart(x, y); manager.updateOnCellBeforeStart(x, y);
((PlateauView) view1).addPosCell(manager.getCell(x, y));
view1.postInvalidate(); view1.postInvalidate();
}catch (IllegalArgumentException e){ }catch (IllegalArgumentException e){
Log.w("WARNING", e.getMessage()); Log.w("WARNING", e.getMessage());

Loading…
Cancel
Save