Skip to content
Snippets Groups Projects
UniformExceptOneGenerator.java 547 B
Newer Older
  • Learn to ignore specific revisions
  • package model;
    
    import javafx.scene.paint.Color;
    
    public class UniformExceptOneGenerator implements ColorGenerator{
        private Color uniColor;
        private Color excepColor;
    
    
        private int counter=0;
    
    
    
    
        public UniformExceptOneGenerator(Color uniformColor, Color exceptionColor){
            this.uniColor=uniformColor;
            this.excepColor=exceptionColor;
        }
        @Override
        public Color nextColor(Cell cell) {
    
            counter++;
            if(counter==2){
    
                return this.excepColor;
    
            return this.uniColor;    }