Skip to content
Snippets Groups Projects
Commit 22b3ec3e authored by RAKOTOARISOA Andrianinarisaina cy's avatar RAKOTOARISOA Andrianinarisaina cy
Browse files

Tâche 4 (7.4) : Implémentation de la classe CyclicColorGenerator avec son...

Tâche 4 (7.4) : Implémentation de la classe CyclicColorGenerator avec son constructeur et la méthode "nextColor"
parent ed407bcb
Branches
No related tags found
No related merge requests found
package model;
import javafx.scene.paint.Color;
import java.util.ArrayList;
import java.util.List;
public class CyclicColorGenerator implements ColorGenerator {
List<Color> color ;
int i ;
//Constructeur de la classe
public CyclicColorGenerator(List<Color> color) {
this.color = color ;
i = 0 ;
}
@Override
public Color nextColor(Cell cell) {
if ( i < this.color.size()) {
return this.color.get(i++);
}
else {
i = 0;
return this.color.get(0);
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment