package model;

import javafx.scene.paint.Color;

import java.util.AbstractList;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class SquareCell extends AbstractCell {

    List<Cell> neighbours;

    public SquareCell() {
        Color cell = DEFAULT_CELL_COLOR;
        this.neighbours = new ArrayList<>();
    }

    public SquareCell(Color color){
       Color cell = color;
       this.neighbours = new ArrayList<>();
    }

    public SquareCell(Color color,List<Cell>neighbours){
        Color cell = color;
        this.neighbours = neighbours;
    }

    @Override
    public List<Cell> getNeighbours() {
        return this.neighbours;
    }


    @Override
    public void setNeighbours(List<Cell> cells) {
        for (int i = 0; i < neighbours.size()  ; i++) {
            this.neighbours.set(i,cells.get(i));
        }
    }

    public Iterator<Cell> iterator(){
        return new ColoredCellIterator(new SquareCell());
    }
}