Skip to content
Snippets Groups Projects
SquareCell.java 1.08 KiB
Newer Older
  • Learn to ignore specific revisions
  • TRAVERS Corentin's avatar
    TRAVERS Corentin committed
    package model;
    
    import javafx.scene.paint.Color;
    
    import java.util.Iterator;
    import java.util.List;
    
    public class SquareCell extends AbstractCell{
    
        public List<Cell>neighbours;
    
        public SquareCell() {
            Color DEFAULT_CELL_COLOR;
            List<Cell> neighbours;
    
        }
        public SquareCell(Color color) {
            this.setColor(color);
            List<Cell> neighbours;
        }
    
        public SquareCell(Color color, List<Cell> neighbours) {
            this.setColor(color);
            this.setNeighbours(neighbours);
        }
    
    
    TRAVERS Corentin's avatar
    TRAVERS Corentin committed
    
    
    
        /**
         * A cell is placed somewhere on a grid. Its neighbours thus depend on the underlying grid.
         *
         * @return the list of cell that are neighbours of this{@code Cell}.
         */
        @Override
    
        public List<Cell> getNeighbours() {return this.neighbours;}
    
    TRAVERS Corentin's avatar
    TRAVERS Corentin committed
        /**
         * Update the list of neighbours of this {@code Cell}.
         *
         * @param cells a list of cells that are the neighbours of this {@code cell}
         *              int the underlying grid.
         */
        @Override
        public void setNeighbours(List<Cell> cells) {
    
            this.neighbours=cells;