BitmapReader.Extensions.PointExtensions.IsANeighborOf C# (CSharp) Method

IsANeighborOf() public static method

public static IsANeighborOf ( this point, Point toPoint ) : bool
point this
toPoint Point
return bool
        public static bool IsANeighborOf(this Point point, Point toPoint)
        {
            return Math.Abs(point.X - toPoint.X) <= 1 && Math.Abs(point.Y - toPoint.Y) <= 1;
        }