Ejemplo n.º 1
0
        private CellInfo getNeighbourCell(CellInfo cell, int deltaX, int deltaY)
        {
            int NewCellId = cell.GetNeighbourCell(deltaX, deltaY);

            if (NewCellId == CellInfo.CELL_ERROR)
            {
                return(null);
            }
            return(_cells[NewCellId]);
        }
Ejemplo n.º 2
0
        CellInfo getNeighbourCell(CellInfo cell, int deltaX, int deltaY, bool fast)
        {
            int      NewCellId = cell.GetNeighbourCell(deltaX, deltaY);
            CellInfo NewCell   = NewCellId == CellInfo.CELL_ERROR ? null : _cells[NewCellId];

            if (fast || NewCell == null || NewCell.DistanceSteps == 0)
            {
                return(NewCell);
            }
            if (!SquareOpen(NewCell, cell))
            {
                return(null);
            }
            NewCell.IsDiagonal = deltaX != 0 && deltaY != 0;
            return(NewCell);
        }
Ejemplo n.º 3
0
 private CellInfo getNeighbourCell(CellInfo cell, int deltaX, int deltaY)
 {
     int NewCellId = cell.GetNeighbourCell(deltaX, deltaY);
     if (NewCellId == CellInfo.CELL_ERROR) return null;
     return _cells[NewCellId];
 }
Ejemplo n.º 4
0
 CellInfo getNeighbourCell(CellInfo cell, int deltaX, int deltaY, bool fast)
 {
     int NewCellId = cell.GetNeighbourCell(deltaX, deltaY);
     CellInfo NewCell = NewCellId == CellInfo.CELL_ERROR ? null : _cells[NewCellId];
     if (fast || NewCell == null || NewCell.DistanceSteps == 0) return NewCell;
     if (!SquareOpen(NewCell, cell)) return null;
     NewCell.IsDiagonal = deltaX != 0 && deltaY != 0;
     return NewCell;
 }