diff --git a/code/app/src/main/java/projet/iut/jeu_de_la_vie/model/Manager.java b/code/app/src/main/java/projet/iut/jeu_de_la_vie/model/Manager.java index e4c3a43..6e8892a 100644 --- a/code/app/src/main/java/projet/iut/jeu_de_la_vie/model/Manager.java +++ b/code/app/src/main/java/projet/iut/jeu_de_la_vie/model/Manager.java @@ -128,6 +128,10 @@ public class Manager implements ObserverBDJ { return actualiseurCellule.getArbitre().getPlateau().getColone(); } + public Cellule getCell(int x, int y){ + return actualiseurCellule.getArbitre().getPlateau().getCell(x, y); + } + public void setCellsColor(int color){ Cellule.setLivingColor(color); } diff --git a/code/app/src/main/java/projet/iut/jeu_de_la_vie/view/PlateauView.java b/code/app/src/main/java/projet/iut/jeu_de_la_vie/view/PlateauView.java index 5b3d483..963fea6 100644 --- a/code/app/src/main/java/projet/iut/jeu_de_la_vie/view/PlateauView.java +++ b/code/app/src/main/java/projet/iut/jeu_de_la_vie/view/PlateauView.java @@ -110,8 +110,8 @@ public class PlateauView extends View implements ObserverCV { } } - public void addPosCell(int x, int y){ - //TODO: Récup la céllue et ajouter dans colors + public void addPosCell(Cellule cellule){ + colors.put(cellule.getPosition(), cellule.getActiveColor()); } public void setColones(int value) throws IllegalArgumentException{ diff --git a/code/app/src/main/java/projet/iut/jeu_de_la_vie/view/fragment/FragmentPlateau.java b/code/app/src/main/java/projet/iut/jeu_de_la_vie/view/fragment/FragmentPlateau.java index fd61650..ea6765b 100644 --- a/code/app/src/main/java/projet/iut/jeu_de_la_vie/view/fragment/FragmentPlateau.java +++ b/code/app/src/main/java/projet/iut/jeu_de_la_vie/view/fragment/FragmentPlateau.java @@ -54,7 +54,7 @@ public class FragmentPlateau extends Fragment { Log.d("D", "y=" + y); try { manager.updateOnCellBeforeStart(x, y); - + ((PlateauView) view1).addPosCell(manager.getCell(x, y)); view1.postInvalidate(); }catch (IllegalArgumentException e){ Log.w("WARNING", e.getMessage());