Skip to content
Snippets Groups Projects
Commit e40a3b2b authored by dragapsy's avatar dragapsy
Browse files

Tache 2

parent cb2265b3
No related branches found
No related tags found
No related merge requests found
...@@ -41,4 +41,13 @@ public class ArrayGrid implements Grid{ ...@@ -41,4 +41,13 @@ public class ArrayGrid implements Grid{
public int getNumberOfColumns() { public int getNumberOfColumns() {
return 0; return 0;
} }
@Override
public void color(ColorGenerator colorGenerator) {
for (int i=0; i<this.numberOfRows;i++){
for(int j=0; j<this.numberOfColumns;j++){
colorGenerator.nextColor(cells[i][j]);
}
}
}
} }
...@@ -27,5 +27,5 @@ public interface Grid { ...@@ -27,5 +27,5 @@ public interface Grid {
* @param colorGenerator the generator used to determine the color of each cell. * @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} * The new color of {@code cell} is obtained by calling the method {@code nextColor}
*/ */
void color(ColorGenerator colorGenerator);
} }
package model;
import javafx.scene.paint.Color;
public class UniformColorGenerator implements ColorGenerator{
@Override
public Color nextColor(Cell cell) {
return null;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment