AStarPathfinder.FindValidFourNeighboursIgnoreTargetCell C# (CSharp) Method

FindValidFourNeighboursIgnoreTargetCell() private method

private FindValidFourNeighboursIgnoreTargetCell ( Node, n ) : void
n Node,
return void
    private void FindValidFourNeighboursIgnoreTargetCell(Node n)
    {
        _neighbours.Clear();
        if ((n.Y - 1 >= 0) && ((_map[n.X][n.Y - 1].IsWalkable()) || _map[n.X][n.Y - 1] == end.Cell))
        {
            Node vn = PrepareNewNodeFrom(n, 0, -1);
            _neighbours.Add(vn);
        }
        if ((n.Y + 1 <= _mapHeight - 1) && ((_map[n.X][n.Y + 1].IsWalkable()) || _map[n.X][n.Y + 1] == end.Cell))
        {
            Node vn = PrepareNewNodeFrom(n, 0, +1);
            _neighbours.Add(vn);
        }
        if ((n.X - 1 >= 0) && ((_map[n.X - 1][n.Y].IsWalkable()) || _map[n.X - 1][n.Y] == end.Cell))
        {
            Node vn = PrepareNewNodeFrom(n, -1, 0);
            _neighbours.Add(vn);
        }
        if ((n.X + 1 <= _mapWidth - 1) && ((_map[n.X + 1][n.Y].IsWalkable()) || _map[n.X + 1][n.Y] == end.Cell))
        {
            Node vn = PrepareNewNodeFrom(n, 1, 0);
            _neighbours.Add(vn);
        }
    }