/// <summary> /// Gets the intersection (common area) of the two rectangles. /// </summary> /// <param name="rectangle"></param> /// <returns></returns> public RectangleF IntersectWith(RectangleF rectangle) { var x = Math.Max(rectangle.X, X); var y = Math.Max(rectangle.Y, Y); var w = Math.Min(rectangle.Width, Width); var h = Math.Min(rectangle.Height, Height); return new RectangleF(x, y, w, h); }
public Map() { terrain = new TerrainMap[320, 240]; TerrainBounds = new RectangleF(Vector.Zero, new Vector(320, 240)); }