diff --git a/README.md b/README.md index f96b6e003acba67574f69665906979be4e7cb8c3..3886e72cd5c9674cfcb051424e9654b6f1b6b241 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # Flooding - ## Description du projet Il s'agit d'implémenter une version du jeu "inondation" (voir par exemple [ici]([Flood-it!](https://unixpapa.com/floodit), ainsi que des intelligences artificiels simples pour y jouer. ## Membre du projet - - RAKOTOARISOA, Andrianina + + diff --git a/app/src/main/java/model/SquareCell.java b/app/src/main/java/model/SquareCell.java index 14f51e9fb9c85ba7fc0c6069ae676556a200bbbe..679509bd607e6009573d1eee600c44079c90f845 100644 --- a/app/src/main/java/model/SquareCell.java +++ b/app/src/main/java/model/SquareCell.java @@ -2,19 +2,36 @@ package model; import javafx.scene.paint.Color; +import java.util.ArrayList; import java.util.Iterator; import java.util.List; public class SquareCell extends AbstractCell{ List<Cell> neighbours; + Color color ; + //constructeur 1 : un constructeur sans paramètres qui construit une liste de cellule vide + //de couleur DEFAULT_CELL_COLOR avec une liste de voisins vide + public void SquareCell() { + this.neighbours = new ArrayList<Cell>() ; + color = DEFAULT_CELL_COLOR ; + } + + //Constructeur 2 : un constructeur ayant en paramètre une couleur color + //qui construit une cellule de couleur color et dont les voisins sont vides + public void SquareCell(Color color) { + this.neighbours = new ArrayList<Cell>() ; + this.color = color ; + } + + //Constructeur 3 : un constructeur avec deux paramètres : "Color color" et "ArrayList<Cell> neighbours + //qui consrtuit une cellule de couleur color et dont les cellules voisines sont neighours + public void SquareCell(Color color, List<Cell> neighbours) { + this.neighbours = neighbours ; + this.color = color ; + } - /** - * A cell is placed somewhere on a grid. Its neighbours thus depend on the underlying grid. - * - * @return the list of cell that are neighbours of this{@code Cell}. - */ @Override public List<Cell> getNeighbours() { return null;