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

colorGenerator

parent df2fc5ef
No related branches found
No related tags found
No related merge requests found
......@@ -27,4 +27,13 @@ public class ArrayGrid implements Grid{
public int getNumberOfColumns() {
return cells[0].length;
}
@Override
public void color(ColorGenerator colorGenerator) {
for(Cell[] column : cells ) {
for(Cell cell : column) {
cell.setColor(colorGenerator.nextColor(cell));
}
}
}
}
......@@ -27,5 +27,8 @@ public interface Grid {
* @param colorGenerator the generator used to determine the color of each cell.
* The new color of {@code cell} is obtained by calling the method {@code nextColor}
*/
void color(ColorGenerator colorGenerator);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment