Skip to content
Snippets Groups Projects
Select Git revision
  • 0d5f9b4cffa67962953e6041e67ff4962eaa211d
  • main default protected
  • master
3 results

BlankImage.java

Blame
  • Forked from YAGOUBI Rim / agency Template
    Source project has a limited visibility.
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    SquareCell.java 1.17 KiB
    package model;
    
    import javafx.scene.paint.Color;
    
    import java.util.ArrayList;
    import java.util.Iterator;
    import java.util.List;
    
    public class SquareCell extends AbstractCell{
    
        List<Cell> neighbours;
    
    
        public SquareCell(){
            setColor(AbstractCell.DEFAULT_CELL_COLOR);
            this.neighbours= new ArrayList<Cell>();
    
    
        }
        public SquareCell( Color color){
            setColor(color);
            this.neighbours= new ArrayList<Cell>();
    
    
        }
        public SquareCell(Color color,List<Cell>neighbours){
            SquareCell Cell=new SquareCell(color);
            setNeighbours(neighbours);
        }
    
    
        /**
         * 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 neighbours;
        }
    
        /**
         * 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;
    
    
        }
    
    
    }