Skip to content
Snippets Groups Projects
Commit a1929313 authored by SAIDI Hatim's avatar SAIDI Hatim
Browse files

test

parent 6cab93ef
No related branches found
No related tags found
No related merge requests found
package model; package model;
import java.util.Iterator;
public class ArrayGrid implements Grid{ public class ArrayGrid implements Grid{
private Cell[][] cells; private Cell[][] cells;
...@@ -34,14 +36,12 @@ public class ArrayGrid implements Grid{ ...@@ -34,14 +36,12 @@ public class ArrayGrid implements Grid{
} }
public void color(ColorGenerator colorGenerator){ public void color(ColorGenerator colorGenerator){
for (int j = 0; j < this.numberOfColumns; j++) { for(Cell cell : this)
for (int i = 0; i < this.numberOfRows; i++) { cell.setColor(colorGenerator.nextColor(new SquareCell()));
SquareCell cell = new SquareCell();
cells[i][j].setColor(colorGenerator.nextColor(cell));
} }
}
public Iterator<Cell> iterator(){
return null ;
} }
......
package model; package model;
public interface Grid { public interface Grid extends Iterable<Cell>{
/** /**
* Return the cell located at the given coordinates in the grid. * Return the cell located at the given coordinates in the grid.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment