Select Git revision
Forked from
COUETOUX Basile / FirefighterStarter
Source project has a limited visibility.
-
COUETOUX Basile authoredCOUETOUX Basile authored
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
ArrayGrid.java 799 B
package model;
public class ArrayGrid implements Grid{
public void arrayGrid(int numberOfRows, int numberOfColumns) {
if(numberOfRows <= 0 || numberOfColumns <= 0)
throw new IllegalArgumentException("Le nombre de lignes ou de colonnes ne peut pas être nul ou négatif.");
Cell[][] cells = new Cell[numberOfRows][numberOfColumns];
for(int i = 0; i < numberOfRows; i++) {
for(int j = 0; j < numberOfColumns; j++) {
cells[i][j] = new SquareCell();
}
}
}
@Override
public Cell getCell(int row, int column) {
return null;
}
@Override
public int getNumberOfRows() {
return cells.length;
}
@Override
public int getNumberOfColumns() {
return 0;
}
}