using Microsoft.Xna.Framework; using MLEM.Extensions; using MonoGame.Extended; namespace MLEM.Extended.Extensions { /// /// A set of extension methods that convert MLEM types to MonoGame.Extended types and vice versa. /// public static class NumberExtensions { /// /// Converts a MLEM to a MonoGame.Extended . /// /// The rectangle to convert /// The converted rectangle public static RectangleF ToExtended(this Misc.RectangleF rect) { return new RectangleF(rect.X, rect.Y, rect.Width, rect.Height); } /// /// Converts a MonoGame.Extended to a MLEM . /// /// The rectangle to convert /// The converted rectangle public static Misc.RectangleF ToMlem(this RectangleF rect) { return new Misc.RectangleF(rect.X, rect.Y, rect.Width, rect.Height); } /// public static bool Penetrate(this RectangleF rect, RectangleF other, out Vector2 normal, out float penetration) { return rect.ToMlem().Penetrate(other.ToMlem(), out normal, out penetration); } } }