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

Tache 4 (La methode nextColor de la classe RandomColorGenerator).

parent 5f8825bd
Branches
No related tags found
No related merge requests found
package model; package model;
import javafx.scene.paint.Color; import javafx.scene.paint.Color;
import util.RandomUtil;
import java.util.List; import java.util.List;
import java.util.Random; import java.util.Random;
...@@ -9,6 +10,8 @@ public class RandomColorGenerator implements ColorGenerator{ ...@@ -9,6 +10,8 @@ public class RandomColorGenerator implements ColorGenerator{
List<Color> colorList; List<Color> colorList;
Random random; Random random;
private RandomUtil randomUtil;
public RandomColorGenerator(List<Color> colors , Random randomGenerator) { public RandomColorGenerator(List<Color> colors , Random randomGenerator) {
colorList = colors; colorList = colors;
...@@ -16,6 +19,6 @@ public class RandomColorGenerator implements ColorGenerator{ ...@@ -16,6 +19,6 @@ public class RandomColorGenerator implements ColorGenerator{
} }
@Override @Override
public Color nextColor(Cell cell) { public Color nextColor(Cell cell) {
return null; return randomUtil.randomElement(colorList,random);
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment