diff --git a/app/src/main/java/model/ArrayGrid.java b/app/src/main/java/model/ArrayGrid.java new file mode 100644 index 0000000000000000000000000000000000000000..e71e8934d6f8165645e4feb8a34b82961c1122ac --- /dev/null +++ b/app/src/main/java/model/ArrayGrid.java @@ -0,0 +1,29 @@ +package model; + +public class ArrayGrid implements Grid{ + + public void arrayGrid(int numberOfRows, int numberOfColumn) { + if(numberOfRows <= 0 || numberOfColumn <= 0) + throw new IllegalArgumentException("Le nombre de lignes ou de colonnes ne peut pas être nul ou négatif."); + Cell[][] cells = new Cell[numberOfRows][numberOfColumn]; + for(int i = 0; i < numberOfRows; i++) { + for(int j = 0; j < numberOfColumn; j++) { + cells[i][j] = new SquareCell(); + } + } + } + @Override + public Cell getCell(int row, int column) { + return null; + } + + @Override + public int getNumberOfRows() { + return 0; + } + + @Override + public int getNumberOfColumns() { + return 0; + } +} diff --git a/app/src/main/java/model/SquareCell.java b/app/src/main/java/model/SquareCell.java index 3b3f157396ca92010786491d687310c86173b0dc..fd829d01bb7be022513cdae53c3c0b68f15c494b 100644 --- a/app/src/main/java/model/SquareCell.java +++ b/app/src/main/java/model/SquareCell.java @@ -7,7 +7,7 @@ import java.util.List; public class SquareCell extends AbstractCell{ - List<Cell> neighbours; + public void squareCell() { Color DEFAULT_CELL_COLOR; List<Cell> neighbours; @@ -25,15 +25,14 @@ public class SquareCell extends AbstractCell{ + /** * 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; - } + public List<Cell> getNeighbours() {return null;} /** * Update the list of neighbours of this {@code Cell}.