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

test

parent 72dffe9d
Branches
No related tags found
No related merge requests found
......@@ -16,7 +16,7 @@ public class ArrayGrid implements Grid{
else {
for (int j = 0; j < this.numberOfColumns; j++) {
for (int i = 0; i < this.numberOfRows; i++) {
cells[numberOfRows][numberOfColumns] = new SquareCell();
cells[i][j] = new SquareCell();
}
}
}
......@@ -33,5 +33,16 @@ public class ArrayGrid implements Grid{
return this.numberOfColumns;
}
public void color(ColorGenerator colorGenerator){
for (int j = 0; j < this.numberOfColumns; j++) {
for (int i = 0; i < this.numberOfRows; i++) {
SquareCell cell = new SquareCell();
cells[i][j].setColor(colorGenerator.nextColor(cell));
}
}
}
}
......@@ -40,4 +40,8 @@ public class GrayGrid implements Grid{
public int getNumberOfColumns() {
return numnberOfColumns;
}
public void color(ColorGenerator colorGenerator){
}
}
......@@ -28,4 +28,5 @@ public interface Grid {
* 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{
public Color nextColor(Cell cell){
return cell.getColor();
}
}
......@@ -11,8 +11,6 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy;
class ArrayGridTest {
// TODO
// uncomment
/*
private ArrayGrid arrayGridThreeFour;
private final ArrayGrid arrayGridTwoTwo = new ArrayGrid(2,2);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment