Example #1
0
 public static List <PointI> GetCells(PointI origin, PointI extent)
 {
     return
         ((from x in Enumerable.Range(origin.X, extent.X)
           from y in Enumerable.Range(origin.Y, extent.Y)
           select new PointI(x, y))
          .ToList());
 }
Example #2
0
        public static bool IsPointInBounds(PointI point, PointI origin, PointI extent)
        {
            var corner = origin + extent;

            return
                (point.X >= origin.X &&
                 point.X < corner.X &&
                 point.Y >= origin.Y &&
                 point.Y < corner.Y);
        }
Example #3
0
        public static bool IsBoundsInBounds(PointI origin, PointI extent, PointI origin2, PointI extent2)
        {
            var corner  = origin + extent;
            var corner2 = origin2 + extent2;

            return
                (origin.X < corner2.X &&
                 corner.X > origin2.X &&
                 origin.Y < corner.Y &&
                 corner.Y > origin2.Y);
        }
Example #4
0
 public static List <PointI> GetCells(PointI extent)
 {
     return(GetCells(PointI.Zero, extent));
 }
Example #5
0
 public static PointI Max(PointI point, PointI point2)
 {
     return(new PointI(
                Math.Max(point.X, point2.X),
                Math.Max(point.Y, point2.Y)));
 }