Skip to content
Snippets Groups Projects
Commit 27665821 authored by BEL KHALIFA Mohamed amine's avatar BEL KHALIFA Mohamed amine
Browse files

Class SquareCell and ArrayGrid

parent aeb942ad
No related branches found
No related tags found
No related merge requests found
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;
}
}
......@@ -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}.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment