diff --git a/app/src/main/java/model/SquareCell.java b/app/src/main/java/model/SquareCell.java index 14f51e9fb9c85ba7fc0c6069ae676556a200bbbe..0fb977513f525785f280faeb3a4db0e1466ed787 100644 --- a/app/src/main/java/model/SquareCell.java +++ b/app/src/main/java/model/SquareCell.java @@ -2,34 +2,39 @@ package model; import javafx.scene.paint.Color; +import java.util.AbstractList; +import java.util.ArrayList; import java.util.Iterator; import java.util.List; -public class SquareCell extends AbstractCell{ +public class SquareCell extends AbstractCell { List<Cell> neighbours; - /** - * 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}. - */ + public SquareCell() { + AbstractCell cell = new SquareCell(); + } + + public SquareCell(Color color){ + AbstractCell cell = new SquareCell(color); + } + + public SquareCell(Color color,List<Cell>neighbours){ + AbstractCell cell = new SquareCell(color,neighbours); + } + @Override public List<Cell> getNeighbours() { - return null; + return this.neighbours; } - /** - * Update the list of neighbours of this {@code Cell}. - * - * @param cells a list of cells that are the neighbours of this {@code cell} - * int the underlying grid. - */ + @Override public void setNeighbours(List<Cell> cells) { - + for (int i = 0; i < neighbours.size() ; i++) { + this.neighbours.set(i,cells.get(i)); + } } - -} +} \ No newline at end of file