Пример #1
0
        public Cell(int row, int column)
        {
            position.x = row;
            position.y = column;

            Neighbours    = new CellNeighbours();
            linkNeigbours = new CellNeighbours();
        }
Пример #2
0
        public CellNeighbours Index2Neighbor(CellNeighbourIndicies indicies)
        {
            CellNeighbours neighbours = new CellNeighbours();

            if (indicies.East != null)
            {
                neighbours.East = _cells[indicies.East.y * Width + indicies.East.x];
            }
            if (indicies.West != null)
            {
                neighbours.West = _cells[indicies.West.y * Width + indicies.West.x];
            }
            if (indicies.North != null)
            {
                neighbours.North = _cells[indicies.North.y * Width + indicies.North.x];
            }
            if (indicies.South != null)
            {
                neighbours.South = _cells[indicies.South.y * Width + indicies.South.x];
            }

            return(neighbours);
        }
Пример #3
0
 public void SetCellLinks(CellNeighbours links)
 {
     this.linkNeigbours = links;
 }
Пример #4
0
 public void SetCellNeigbours(CellNeighbours neighbours)
 {
     this.Neighbours = neighbours;
 }