diff --git a/CHANGELOG.md b/CHANGELOG.md index ead7edb..8baecb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ Additions Improvements - **Made the Keybind.Combinations collection a public property** +- **Moved extension methods into matching namespaces to avoid unexpected suggestions** - Allow NumberExtensions.GetPoints to include bottom and right coordinates - Allow AutoTiling overlayTextures to return null texture regions @@ -56,9 +57,13 @@ Removals ### MLEM.Extended Improvements - **Added compatibility for MonoGame.Extended 4.0.0** +- **Moved extension methods into matching namespaces to avoid unexpected suggestions** - Added compatibility for FNA.Extended ### MLEM.Data +Improvements +- **Moved extension methods into matching namespaces to avoid unexpected suggestions** + Removals - **Removed obsolete types DynamicEnumConverter, CopyExtensions, DynamicEnum, NetBufferSerializer, and NetExtensions** diff --git a/Demos.Android/Activity1.cs b/Demos.Android/Activity1.cs index af0713d..74303cf 100644 --- a/Demos.Android/Activity1.cs +++ b/Demos.Android/Activity1.cs @@ -5,7 +5,7 @@ using Android.OS; using Android.Views; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Input; -using MLEM.Extensions; +using MLEM.Graphics; using MLEM.Misc; using Uri = Android.Net.Uri; diff --git a/Demos/AnimationDemo.cs b/Demos/AnimationDemo.cs index 7b4731f..ca9da3c 100644 --- a/Demos/AnimationDemo.cs +++ b/Demos/AnimationDemo.cs @@ -2,7 +2,7 @@ using System; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using MLEM.Animations; -using MLEM.Misc; +using MLEM.Maths; using MLEM.Startup; using MLEM.Textures; using MLEM.Ui; diff --git a/Demos/AutoTilingDemo.cs b/Demos/AutoTilingDemo.cs index d062f36..f7f3f28 100644 --- a/Demos/AutoTilingDemo.cs +++ b/Demos/AutoTilingDemo.cs @@ -1,7 +1,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using MLEM.Extensions; using MLEM.Graphics; +using MLEM.Maths; using MLEM.Startup; using MLEM.Textures; diff --git a/Demos/EasingsDemo.cs b/Demos/EasingsDemo.cs index f77d6df..7c73ed8 100644 --- a/Demos/EasingsDemo.cs +++ b/Demos/EasingsDemo.cs @@ -2,8 +2,8 @@ using System.Linq; using System.Reflection; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using MLEM.Extensions; -using MLEM.Misc; +using MLEM.Graphics; +using MLEM.Maths; using MLEM.Startup; using MLEM.Ui; using MLEM.Ui.Elements; diff --git a/Demos/PathfindingDemo.cs b/Demos/PathfindingDemo.cs index a8c89a7..6730fe2 100644 --- a/Demos/PathfindingDemo.cs +++ b/Demos/PathfindingDemo.cs @@ -4,8 +4,8 @@ using System.Linq; using System.Threading.Tasks; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using MLEM.Extensions; -using MLEM.Misc; +using MLEM.Graphics; +using MLEM.Maths; using MLEM.Pathfinding; using MLEM.Startup; using MLEM.Ui; diff --git a/Demos/TextFormattingDemo.cs b/Demos/TextFormattingDemo.cs index fc89a27..dffe83f 100644 --- a/Demos/TextFormattingDemo.cs +++ b/Demos/TextFormattingDemo.cs @@ -2,11 +2,11 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; -using MLEM.Extensions; using MLEM.Font; using MLEM.Formatting; using MLEM.Formatting.Codes; -using MLEM.Misc; +using MLEM.Graphics; +using MLEM.Maths; using MLEM.Startup; using MLEM.Textures; diff --git a/Demos/UiDemo.cs b/Demos/UiDemo.cs index e050dc8..7e6062a 100644 --- a/Demos/UiDemo.cs +++ b/Demos/UiDemo.cs @@ -5,11 +5,10 @@ using System.Linq; using Coroutine; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using MLEM.Extensions; using MLEM.Font; using MLEM.Formatting; using MLEM.Input; -using MLEM.Misc; +using MLEM.Maths; using MLEM.Startup; using MLEM.Textures; using MLEM.Ui; diff --git a/MLEM.Data/ContentExtensions.cs b/MLEM.Data/Content/ContentExtensions.cs similarity index 99% rename from MLEM.Data/ContentExtensions.cs rename to MLEM.Data/Content/ContentExtensions.cs index 943d94f..27d5c28 100644 --- a/MLEM.Data/ContentExtensions.cs +++ b/MLEM.Data/Content/ContentExtensions.cs @@ -5,7 +5,7 @@ using Microsoft.Xna.Framework.Content; using MLEM.Data.Json; using Newtonsoft.Json; -namespace MLEM.Data { +namespace MLEM.Data.Content { /// /// A set of extensions for dealing with /// diff --git a/MLEM.Data/Content/Texture2DReader.cs b/MLEM.Data/Content/Texture2DReader.cs index 57f47fe..965ece6 100644 --- a/MLEM.Data/Content/Texture2DReader.cs +++ b/MLEM.Data/Content/Texture2DReader.cs @@ -1,7 +1,7 @@ using System.IO; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using MLEM.Extensions; +using MLEM.Textures; namespace MLEM.Data.Content { /// diff --git a/MLEM.Data/DataTextureAtlas.cs b/MLEM.Data/DataTextureAtlas.cs index d7ca8f8..c1bd120 100644 --- a/MLEM.Data/DataTextureAtlas.cs +++ b/MLEM.Data/DataTextureAtlas.cs @@ -6,7 +6,7 @@ using System.Text.RegularExpressions; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; -using MLEM.Extensions; +using MLEM.Maths; using MLEM.Misc; using MLEM.Textures; diff --git a/MLEM.Data/Json/Direction2Converter.cs b/MLEM.Data/Json/Direction2Converter.cs index 043350e..438a598 100644 --- a/MLEM.Data/Json/Direction2Converter.cs +++ b/MLEM.Data/Json/Direction2Converter.cs @@ -1,5 +1,5 @@ using System; -using MLEM.Misc; +using MLEM.Maths; using Newtonsoft.Json; namespace MLEM.Data.Json { diff --git a/MLEM.Data/Json/JsonConverters.cs b/MLEM.Data/Json/JsonConverters.cs index 77161c3..1628a43 100644 --- a/MLEM.Data/Json/JsonConverters.cs +++ b/MLEM.Data/Json/JsonConverters.cs @@ -1,5 +1,3 @@ -using System; -using System.Linq; using Newtonsoft.Json; namespace MLEM.Data.Json { diff --git a/MLEM.Data/Json/JsonTypeSafeGenericDataHolder.cs b/MLEM.Data/Json/JsonTypeSafeGenericDataHolder.cs index ef87d0d..41bbfd2 100644 --- a/MLEM.Data/Json/JsonTypeSafeGenericDataHolder.cs +++ b/MLEM.Data/Json/JsonTypeSafeGenericDataHolder.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using MLEM.Misc; using Newtonsoft.Json; diff --git a/MLEM.Data/Json/RectangleFConverter.cs b/MLEM.Data/Json/RectangleFConverter.cs index 6251dd7..3b3dc97 100644 --- a/MLEM.Data/Json/RectangleFConverter.cs +++ b/MLEM.Data/Json/RectangleFConverter.cs @@ -1,6 +1,6 @@ using System; using System.Globalization; -using MLEM.Misc; +using MLEM.Maths; using Newtonsoft.Json; namespace MLEM.Data.Json { diff --git a/MLEM.Data/RuntimeTexturePacker.cs b/MLEM.Data/RuntimeTexturePacker.cs index 6954ca3..9d2f66f 100644 --- a/MLEM.Data/RuntimeTexturePacker.cs +++ b/MLEM.Data/RuntimeTexturePacker.cs @@ -4,9 +4,9 @@ using System.Diagnostics; using System.Linq; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using MLEM.Extensions; +using MLEM.Maths; using MLEM.Textures; -using static MLEM.Extensions.TextureExtensions; +using static MLEM.Textures.TextureExtensions; namespace MLEM.Data { /// diff --git a/MLEM.Extended/Extensions/SpriteBatchExtensions.cs b/MLEM.Extended/Graphics/SpriteBatchExtensions.cs similarity index 97% rename from MLEM.Extended/Extensions/SpriteBatchExtensions.cs rename to MLEM.Extended/Graphics/SpriteBatchExtensions.cs index 1e6f52e..d816ec0 100644 --- a/MLEM.Extended/Extensions/SpriteBatchExtensions.cs +++ b/MLEM.Extended/Graphics/SpriteBatchExtensions.cs @@ -1,10 +1,12 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using MLEM.Extensions; +using MLEM.Extended.Maths; +using MLEM.Graphics; +using MLEM.Maths; using ShapeExtensions = MonoGame.Extended.ShapeExtensions; using RectangleF = MonoGame.Extended.RectangleF; -namespace MLEM.Extended.Extensions { +namespace MLEM.Extended.Graphics { /// /// A set of extension methods for dealing with and in combination. /// diff --git a/MLEM.Extended/Extensions/TextureExtensions.cs b/MLEM.Extended/Graphics/TextureExtensions.cs similarity index 96% rename from MLEM.Extended/Extensions/TextureExtensions.cs rename to MLEM.Extended/Graphics/TextureExtensions.cs index 31907b8..47d4316 100644 --- a/MLEM.Extended/Extensions/TextureExtensions.cs +++ b/MLEM.Extended/Graphics/TextureExtensions.cs @@ -1,10 +1,10 @@ -using MLEM.Extensions; +using MLEM.Maths; using MLEM.Textures; using MonoGame.Extended.Graphics; using NinePatch = MLEM.Textures.NinePatch; using ExtNinePatch = MonoGame.Extended.Graphics.NinePatch; -namespace MLEM.Extended.Extensions { +namespace MLEM.Extended.Graphics { /// /// A set of extensions for converting texture-related types between MLEM and MonoGame.Extended. /// diff --git a/MLEM.Extended/MLEM.Extended.FNA.csproj b/MLEM.Extended/MLEM.Extended.FNA.csproj index 48dfa26..d8bb241 100644 --- a/MLEM.Extended/MLEM.Extended.FNA.csproj +++ b/MLEM.Extended/MLEM.Extended.FNA.csproj @@ -37,7 +37,10 @@ - + + + + diff --git a/MLEM.Extended/MLEM.Extended.csproj b/MLEM.Extended/MLEM.Extended.csproj index 6ede548..d298de6 100644 --- a/MLEM.Extended/MLEM.Extended.csproj +++ b/MLEM.Extended/MLEM.Extended.csproj @@ -34,7 +34,10 @@ - + + + + diff --git a/MLEM.Extended/Extensions/NumberExtensions.cs b/MLEM.Extended/Maths/NumberExtensions.cs similarity index 86% rename from MLEM.Extended/Extensions/NumberExtensions.cs rename to MLEM.Extended/Maths/NumberExtensions.cs index 3ae1385..56486f8 100644 --- a/MLEM.Extended/Extensions/NumberExtensions.cs +++ b/MLEM.Extended/Maths/NumberExtensions.cs @@ -1,29 +1,31 @@ using Microsoft.Xna.Framework; -using MLEM.Extensions; +using MLEM.Maths; using MonoGame.Extended; +using MlemRectangleF = MLEM.Maths.RectangleF; +using ExtRectangleF = MonoGame.Extended.RectangleF; -namespace MLEM.Extended.Extensions { +namespace MLEM.Extended.Maths { /// /// 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 . + /// 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); + public static ExtRectangleF ToExtended(this MlemRectangleF rect) { + return new ExtRectangleF(rect.X, rect.Y, rect.Width, rect.Height); } /// - /// Converts a MonoGame.Extended to a MLEM . + /// 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 MlemRectangleF ToMlem(this ExtRectangleF rect) { + return new MlemRectangleF(rect.X, rect.Y, rect.Width, rect.Height); } /// @@ -36,7 +38,7 @@ namespace MLEM.Extended.Extensions { /// The direction that the penetration occured in /// The amount that the penetration occured by, in the direction of /// Whether or not a penetration occured - public static bool Penetrate(this RectangleF rect, RectangleF other, out Vector2 normal, out float penetration) { + public static bool Penetrate(this ExtRectangleF rect, ExtRectangleF other, out Vector2 normal, out float penetration) { return rect.ToMlem().Penetrate(other.ToMlem(), out normal, out penetration); } diff --git a/MLEM.Extended/Extensions/RandomExtensions.cs b/MLEM.Extended/Maths/RandomExtensions.cs similarity index 97% rename from MLEM.Extended/Extensions/RandomExtensions.cs rename to MLEM.Extended/Maths/RandomExtensions.cs index 956095d..9c69f05 100644 --- a/MLEM.Extended/Extensions/RandomExtensions.cs +++ b/MLEM.Extended/Maths/RandomExtensions.cs @@ -2,7 +2,7 @@ using System; using Microsoft.Xna.Framework; using MonoGame.Extended; -namespace MLEM.Extended.Extensions { +namespace MLEM.Extended.Maths { /// /// A set of extension methods for dealing with /// diff --git a/MLEM.Extended/Tiled/IndividualTiledMapRenderer.cs b/MLEM.Extended/Tiled/IndividualTiledMapRenderer.cs index 7d175e6..954b76d 100644 --- a/MLEM.Extended/Tiled/IndividualTiledMapRenderer.cs +++ b/MLEM.Extended/Tiled/IndividualTiledMapRenderer.cs @@ -3,8 +3,8 @@ using System.Collections.Generic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using MLEM.Cameras; -using MLEM.Extensions; using MLEM.Graphics; +using MLEM.Maths; using MLEM.Misc; using MonoGame.Extended.Tiled; using RectangleF = MonoGame.Extended.RectangleF; diff --git a/MLEM.Extended/Tiled/TiledExtensions.cs b/MLEM.Extended/Tiled/TiledExtensions.cs index 5bca79d..e4b9d54 100644 --- a/MLEM.Extended/Tiled/TiledExtensions.cs +++ b/MLEM.Extended/Tiled/TiledExtensions.cs @@ -5,7 +5,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using MonoGame.Extended; using MonoGame.Extended.Tiled; -using ColorHelper = MLEM.Extensions.ColorHelper; +using ColorHelper = MLEM.Graphics.ColorHelper; namespace MLEM.Extended.Tiled { /// diff --git a/MLEM.Extended/Tiled/TiledMapCollisions.cs b/MLEM.Extended/Tiled/TiledMapCollisions.cs index 389265c..36a5f3c 100644 --- a/MLEM.Extended/Tiled/TiledMapCollisions.cs +++ b/MLEM.Extended/Tiled/TiledMapCollisions.cs @@ -2,8 +2,8 @@ using System; using System.Collections.Generic; using System.Linq; using Microsoft.Xna.Framework; -using MLEM.Extended.Extensions; -using MLEM.Extensions; +using MLEM.Extended.Maths; +using MLEM.Maths; using MLEM.Misc; using MonoGame.Extended.Tiled; using RectangleF = MonoGame.Extended.RectangleF; @@ -125,7 +125,7 @@ namespace MLEM.Extended.Tiled { /// /// Returns an enumerable of normals and penetration amounts for each that intersects with the given area. - /// The normals and penetration amounts are based on . + /// The normals and penetration amounts are based on . /// Note that all x penetrations are returned before all y penetrations, which improves collision detection in sidescrolling games with gravity. Note that this behavior can be inverted using . /// /// The area to penetrate diff --git a/MLEM.Ui/Elements/Button.cs b/MLEM.Ui/Elements/Button.cs index bd74f49..3cd1623 100644 --- a/MLEM.Ui/Elements/Button.cs +++ b/MLEM.Ui/Elements/Button.cs @@ -2,7 +2,7 @@ using System; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using MLEM.Graphics; -using MLEM.Misc; +using MLEM.Maths; using MLEM.Textures; using MLEM.Ui.Style; diff --git a/MLEM.Ui/Elements/Checkbox.cs b/MLEM.Ui/Elements/Checkbox.cs index 291f8e6..7658c52 100644 --- a/MLEM.Ui/Elements/Checkbox.cs +++ b/MLEM.Ui/Elements/Checkbox.cs @@ -1,7 +1,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using MLEM.Graphics; -using MLEM.Misc; +using MLEM.Maths; using MLEM.Textures; using MLEM.Ui.Style; diff --git a/MLEM.Ui/Elements/Dropdown.cs b/MLEM.Ui/Elements/Dropdown.cs index 6f2e7ac..bf6f805 100644 --- a/MLEM.Ui/Elements/Dropdown.cs +++ b/MLEM.Ui/Elements/Dropdown.cs @@ -1,6 +1,6 @@ using System.Linq; using Microsoft.Xna.Framework; -using MLEM.Misc; +using MLEM.Maths; namespace MLEM.Ui.Elements { /// diff --git a/MLEM.Ui/Elements/Element.cs b/MLEM.Ui/Elements/Element.cs index fedefd4..38d0d6c 100644 --- a/MLEM.Ui/Elements/Element.cs +++ b/MLEM.Ui/Elements/Element.cs @@ -6,9 +6,9 @@ using System.Linq; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; -using MLEM.Extensions; using MLEM.Graphics; using MLEM.Input; +using MLEM.Maths; using MLEM.Misc; using MLEM.Sound; using MLEM.Textures; diff --git a/MLEM.Ui/Elements/ElementHelper.cs b/MLEM.Ui/Elements/ElementHelper.cs index cd7e0a6..466f09c 100644 --- a/MLEM.Ui/Elements/ElementHelper.cs +++ b/MLEM.Ui/Elements/ElementHelper.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using Microsoft.Xna.Framework; using MLEM.Input; +using MLEM.Maths; using MLEM.Misc; using MLEM.Textures; diff --git a/MLEM.Ui/Elements/Image.cs b/MLEM.Ui/Elements/Image.cs index 26411aa..59fcf34 100644 --- a/MLEM.Ui/Elements/Image.cs +++ b/MLEM.Ui/Elements/Image.cs @@ -2,12 +2,9 @@ using System; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using MLEM.Graphics; -using MLEM.Misc; +using MLEM.Maths; using MLEM.Textures; using MLEM.Ui.Style; -#if FNA -using MLEM.Extensions; -#endif namespace MLEM.Ui.Elements { /// diff --git a/MLEM.Ui/Elements/Panel.cs b/MLEM.Ui/Elements/Panel.cs index c07ae92..c7adb25 100644 --- a/MLEM.Ui/Elements/Panel.cs +++ b/MLEM.Ui/Elements/Panel.cs @@ -3,9 +3,8 @@ using System.Collections.Generic; using System.Linq; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using MLEM.Extensions; using MLEM.Graphics; -using MLEM.Misc; +using MLEM.Maths; using MLEM.Textures; using MLEM.Ui.Style; diff --git a/MLEM.Ui/Elements/Paragraph.cs b/MLEM.Ui/Elements/Paragraph.cs index 7655cb9..1e4972c 100644 --- a/MLEM.Ui/Elements/Paragraph.cs +++ b/MLEM.Ui/Elements/Paragraph.cs @@ -2,11 +2,11 @@ using System; using System.Linq; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using MLEM.Extensions; using MLEM.Font; using MLEM.Formatting; using MLEM.Formatting.Codes; using MLEM.Graphics; +using MLEM.Maths; using MLEM.Misc; using MLEM.Ui.Style; diff --git a/MLEM.Ui/Elements/ProgressBar.cs b/MLEM.Ui/Elements/ProgressBar.cs index 000e71d..2eae4f5 100644 --- a/MLEM.Ui/Elements/ProgressBar.cs +++ b/MLEM.Ui/Elements/ProgressBar.cs @@ -1,9 +1,8 @@ using System; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using MLEM.Extensions; using MLEM.Graphics; -using MLEM.Misc; +using MLEM.Maths; using MLEM.Textures; using MLEM.Ui.Style; diff --git a/MLEM.Ui/Elements/ScissorGroup.cs b/MLEM.Ui/Elements/ScissorGroup.cs index 2330d0d..d5b1a8b 100644 --- a/MLEM.Ui/Elements/ScissorGroup.cs +++ b/MLEM.Ui/Elements/ScissorGroup.cs @@ -1,7 +1,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using MLEM.Extensions; using MLEM.Graphics; +using MLEM.Maths; namespace MLEM.Ui.Elements { /// diff --git a/MLEM.Ui/Elements/ScrollBar.cs b/MLEM.Ui/Elements/ScrollBar.cs index 0e5bcc8..098b396 100644 --- a/MLEM.Ui/Elements/ScrollBar.cs +++ b/MLEM.Ui/Elements/ScrollBar.cs @@ -5,12 +5,9 @@ using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input.Touch; using MLEM.Graphics; using MLEM.Input; -using MLEM.Misc; +using MLEM.Maths; using MLEM.Textures; using MLEM.Ui.Style; -#if FNA -using MLEM.Extensions; -#endif namespace MLEM.Ui.Elements { /// diff --git a/MLEM.Ui/Elements/Slider.cs b/MLEM.Ui/Elements/Slider.cs index 31be823..e57538d 100644 --- a/MLEM.Ui/Elements/Slider.cs +++ b/MLEM.Ui/Elements/Slider.cs @@ -1,5 +1,5 @@ using Microsoft.Xna.Framework; -using MLEM.Misc; +using MLEM.Maths; namespace MLEM.Ui.Elements { /// diff --git a/MLEM.Ui/Elements/SquishingGroup.cs b/MLEM.Ui/Elements/SquishingGroup.cs index 7e28ccc..0053adc 100644 --- a/MLEM.Ui/Elements/SquishingGroup.cs +++ b/MLEM.Ui/Elements/SquishingGroup.cs @@ -1,8 +1,7 @@ using System; using System.Linq; using Microsoft.Xna.Framework; -using MLEM.Extensions; -using MLEM.Misc; +using MLEM.Maths; namespace MLEM.Ui.Elements { /// diff --git a/MLEM.Ui/Elements/TextField.cs b/MLEM.Ui/Elements/TextField.cs index 998e3cd..40600aa 100644 --- a/MLEM.Ui/Elements/TextField.cs +++ b/MLEM.Ui/Elements/TextField.cs @@ -5,6 +5,7 @@ using Microsoft.Xna.Framework.Input; using MLEM.Font; using MLEM.Graphics; using MLEM.Input; +using MLEM.Maths; using MLEM.Misc; using MLEM.Textures; using MLEM.Ui.Style; diff --git a/MLEM.Ui/Elements/Tooltip.cs b/MLEM.Ui/Elements/Tooltip.cs index bae6a2a..1fc67be 100644 --- a/MLEM.Ui/Elements/Tooltip.cs +++ b/MLEM.Ui/Elements/Tooltip.cs @@ -1,13 +1,12 @@ using System; using System.Collections.Generic; -using System.Drawing; using Microsoft.Xna.Framework; using MLEM.Input; using MLEM.Ui.Style; using Color = Microsoft.Xna.Framework.Color; -using RectangleF = MLEM.Misc.RectangleF; +using RectangleF = MLEM.Maths.RectangleF; #if FNA -using MLEM.Extensions; +using MLEM.Maths; #endif namespace MLEM.Ui.Elements { diff --git a/MLEM.Ui/Style/UiStyle.cs b/MLEM.Ui/Style/UiStyle.cs index e9f2cc5..36b73ff 100644 --- a/MLEM.Ui/Style/UiStyle.cs +++ b/MLEM.Ui/Style/UiStyle.cs @@ -4,6 +4,7 @@ using Microsoft.Xna.Framework; using MLEM.Font; using MLEM.Formatting; using MLEM.Formatting.Codes; +using MLEM.Maths; using MLEM.Misc; using MLEM.Sound; using MLEM.Textures; diff --git a/MLEM.Ui/Style/UntexturedStyle.cs b/MLEM.Ui/Style/UntexturedStyle.cs index 50a1c5c..f89c003 100644 --- a/MLEM.Ui/Style/UntexturedStyle.cs +++ b/MLEM.Ui/Style/UntexturedStyle.cs @@ -1,6 +1,6 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using MLEM.Extensions; +using MLEM.Graphics; namespace MLEM.Ui.Style { /// diff --git a/MLEM.Ui/UiControls.cs b/MLEM.Ui/UiControls.cs index a8d35ad..f8ef52f 100644 --- a/MLEM.Ui/UiControls.cs +++ b/MLEM.Ui/UiControls.cs @@ -5,12 +5,12 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Input.Touch; using MLEM.Input; +using MLEM.Maths; using MLEM.Misc; using MLEM.Ui.Elements; using MLEM.Ui.Style; #if NET452 -using MLEM.Extensions; #endif namespace MLEM.Ui { diff --git a/MLEM/Cameras/Camera.cs b/MLEM/Cameras/Camera.cs index 171c3e1..3fba7e2 100644 --- a/MLEM/Cameras/Camera.cs +++ b/MLEM/Cameras/Camera.cs @@ -1,8 +1,7 @@ using System; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using MLEM.Extensions; -using MLEM.Misc; +using MLEM.Maths; namespace MLEM.Cameras { /// diff --git a/MLEM/Formatting/Codes/Code.cs b/MLEM/Formatting/Codes/Code.cs index f2c8ec3..8ae6af2 100644 --- a/MLEM/Formatting/Codes/Code.cs +++ b/MLEM/Formatting/Codes/Code.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Text.RegularExpressions; using Microsoft.Xna.Framework; diff --git a/MLEM/Formatting/Codes/ImageCode.cs b/MLEM/Formatting/Codes/ImageCode.cs index 3a7cd2d..2497293 100644 --- a/MLEM/Formatting/Codes/ImageCode.cs +++ b/MLEM/Formatting/Codes/ImageCode.cs @@ -2,9 +2,9 @@ using System.Text.RegularExpressions; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using MLEM.Animations; -using MLEM.Extensions; using MLEM.Font; -using MLEM.Misc; +using MLEM.Graphics; +using MLEM.Maths; using MLEM.Textures; namespace MLEM.Formatting.Codes { diff --git a/MLEM/Formatting/Codes/OutlineCode.cs b/MLEM/Formatting/Codes/OutlineCode.cs index 1b8be7b..9a4c3c3 100644 --- a/MLEM/Formatting/Codes/OutlineCode.cs +++ b/MLEM/Formatting/Codes/OutlineCode.cs @@ -1,10 +1,9 @@ -using System; -using System.Text.RegularExpressions; +using System.Text.RegularExpressions; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using MLEM.Extensions; using MLEM.Font; -using MLEM.Misc; +using MLEM.Graphics; +using MLEM.Maths; namespace MLEM.Formatting.Codes { /// diff --git a/MLEM/Formatting/Codes/ShadowCode.cs b/MLEM/Formatting/Codes/ShadowCode.cs index dc36126..aaae004 100644 --- a/MLEM/Formatting/Codes/ShadowCode.cs +++ b/MLEM/Formatting/Codes/ShadowCode.cs @@ -1,8 +1,8 @@ using System.Text.RegularExpressions; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using MLEM.Extensions; using MLEM.Font; +using MLEM.Graphics; namespace MLEM.Formatting.Codes { /// diff --git a/MLEM/Formatting/Codes/UnderlineCode.cs b/MLEM/Formatting/Codes/UnderlineCode.cs index 4f1f5b1..f255cab 100644 --- a/MLEM/Formatting/Codes/UnderlineCode.cs +++ b/MLEM/Formatting/Codes/UnderlineCode.cs @@ -1,9 +1,9 @@ using System.Text.RegularExpressions; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using MLEM.Extensions; using MLEM.Font; -using MLEM.Misc; +using MLEM.Graphics; +using MLEM.Maths; namespace MLEM.Formatting.Codes { /// diff --git a/MLEM/Formatting/TextFormatter.cs b/MLEM/Formatting/TextFormatter.cs index 1459273..3f0a16a 100644 --- a/MLEM/Formatting/TextFormatter.cs +++ b/MLEM/Formatting/TextFormatter.cs @@ -4,9 +4,9 @@ using System.Globalization; using System.Linq; using System.Text.RegularExpressions; using Microsoft.Xna.Framework; -using MLEM.Extensions; using MLEM.Font; using MLEM.Formatting.Codes; +using MLEM.Graphics; using MLEM.Misc; namespace MLEM.Formatting { diff --git a/MLEM/Formatting/Token.cs b/MLEM/Formatting/Token.cs index eaa1faa..7d7e3b5 100644 --- a/MLEM/Formatting/Token.cs +++ b/MLEM/Formatting/Token.cs @@ -5,6 +5,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using MLEM.Font; using MLEM.Formatting.Codes; +using MLEM.Maths; using MLEM.Misc; namespace MLEM.Formatting { diff --git a/MLEM/Formatting/TokenizedString.cs b/MLEM/Formatting/TokenizedString.cs index 9c40b82..8e22bde 100644 --- a/MLEM/Formatting/TokenizedString.cs +++ b/MLEM/Formatting/TokenizedString.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -6,6 +5,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using MLEM.Font; using MLEM.Formatting.Codes; +using MLEM.Maths; using MLEM.Misc; namespace MLEM.Formatting { diff --git a/MLEM/Graphics/AutoTiling.cs b/MLEM/Graphics/AutoTiling.cs index 2934483..a3d6756 100644 --- a/MLEM/Graphics/AutoTiling.cs +++ b/MLEM/Graphics/AutoTiling.cs @@ -2,7 +2,7 @@ using System; using System.Collections.Generic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using MLEM.Misc; +using MLEM.Maths; using MLEM.Textures; namespace MLEM.Graphics { @@ -128,7 +128,7 @@ namespace MLEM.Graphics { AutoTiling.DrawExtendedAutoTileCorner(batch, pos, overlayTextures, connectsTo, overlayColor, Direction2.DownRight, origin, scale, od); } - /// + /// public static void DrawExtendedAutoTileCorner(SpriteBatch batch, Vector2 pos, Func overlayTextures, ConnectsTo connectsTo, Color overlayColor, Direction2 corner, Vector2? origin = null, Vector2? scale = null, float layerDepth = 0) { var src = AutoTiling.CalculateExtendedAutoTileOffset(connectsTo, corner); if (src >= 0) { @@ -151,7 +151,7 @@ namespace MLEM.Graphics { AutoTiling.AddExtendedAutoTileCorner(batch, pos, overlayTexture, connectsTo, overlayColor, Direction2.DownRight, origin, scale, od, items); } - /// + /// public static void AddExtendedAutoTileCorner(StaticSpriteBatch batch, Vector2 pos, TextureRegion overlayTexture, ConnectsTo connectsTo, Color overlayColor, Direction2 corner, Vector2? origin = null, Vector2? scale = null, float layerDepth = 0, ICollection items = null) { var src = AutoTiling.CalculateExtendedAutoTile(overlayTexture.Area, connectsTo, corner); if (src != Rectangle.Empty) { @@ -173,7 +173,7 @@ namespace MLEM.Graphics { AutoTiling.AddExtendedAutoTileCorner(batch, pos, overlayTextures, connectsTo, overlayColor, Direction2.DownRight, origin, scale, od, items); } - /// + /// public static void AddExtendedAutoTileCorner(StaticSpriteBatch batch, Vector2 pos, Func overlayTextures, ConnectsTo connectsTo, Color overlayColor, Direction2 corner, Vector2? origin = null, Vector2? scale = null, float layerDepth = 0, ICollection items = null) { var src = AutoTiling.CalculateExtendedAutoTileOffset(connectsTo, corner); if (src >= 0) { diff --git a/MLEM/Extensions/ColorExtensions.cs b/MLEM/Graphics/ColorExtensions.cs similarity index 99% rename from MLEM/Extensions/ColorExtensions.cs rename to MLEM/Graphics/ColorExtensions.cs index 0ceebe0..7c4faca 100644 --- a/MLEM/Extensions/ColorExtensions.cs +++ b/MLEM/Graphics/ColorExtensions.cs @@ -2,7 +2,7 @@ using System; using System.Globalization; using Microsoft.Xna.Framework; -namespace MLEM.Extensions { +namespace MLEM.Graphics { /// /// A set of extensions for dealing with objects. /// diff --git a/MLEM/Extensions/GraphicsExtensions.cs b/MLEM/Graphics/GraphicsExtensions.cs similarity index 99% rename from MLEM/Extensions/GraphicsExtensions.cs rename to MLEM/Graphics/GraphicsExtensions.cs index 57dd9b8..bdbd044 100644 --- a/MLEM/Extensions/GraphicsExtensions.cs +++ b/MLEM/Graphics/GraphicsExtensions.cs @@ -2,7 +2,7 @@ using System; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -namespace MLEM.Extensions { +namespace MLEM.Graphics { /// /// A set of extensions for dealing with and /// diff --git a/MLEM/Extensions/SpriteBatchExtensions.cs b/MLEM/Graphics/SpriteBatchExtensions.cs similarity index 99% rename from MLEM/Extensions/SpriteBatchExtensions.cs rename to MLEM/Graphics/SpriteBatchExtensions.cs index 907692c..e44f774 100644 --- a/MLEM/Extensions/SpriteBatchExtensions.cs +++ b/MLEM/Graphics/SpriteBatchExtensions.cs @@ -1,10 +1,9 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using MLEM.Graphics; -using MLEM.Misc; +using MLEM.Maths; using MLEM.Textures; -namespace MLEM.Extensions { +namespace MLEM.Graphics { /// /// A set of extensions for dealing with /// diff --git a/MLEM/Graphics/StaticSpriteBatch.cs b/MLEM/Graphics/StaticSpriteBatch.cs index 20bc5b6..e343a84 100644 --- a/MLEM/Graphics/StaticSpriteBatch.cs +++ b/MLEM/Graphics/StaticSpriteBatch.cs @@ -4,7 +4,7 @@ using System.Linq; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; #if FNA -using MLEM.Extensions; +using MLEM.Maths; using System.IO; #endif diff --git a/MLEM/Input/Keybind.cs b/MLEM/Input/Keybind.cs index e51d6b7..0c1b9b8 100644 --- a/MLEM/Input/Keybind.cs +++ b/MLEM/Input/Keybind.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Runtime.Serialization; #if NET452 -using MLEM.Extensions; +using MLEM.Misc; #endif namespace MLEM.Input { diff --git a/MLEM/Input/KeysExtensions.cs b/MLEM/Input/KeysExtensions.cs index a397da0..32eb906 100644 --- a/MLEM/Input/KeysExtensions.cs +++ b/MLEM/Input/KeysExtensions.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Linq; using Microsoft.Xna.Framework.Input; diff --git a/MLEM/Input/TextInput.cs b/MLEM/Input/TextInput.cs index 3a45970..bd2c2d6 100644 --- a/MLEM/Input/TextInput.cs +++ b/MLEM/Input/TextInput.cs @@ -5,8 +5,9 @@ using System.Text; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; -using MLEM.Extensions; using MLEM.Font; +using MLEM.Graphics; +using MLEM.Maths; using MLEM.Misc; namespace MLEM.Input { diff --git a/MLEM/Misc/Direction2.cs b/MLEM/Maths/Direction2.cs similarity index 99% rename from MLEM/Misc/Direction2.cs rename to MLEM/Maths/Direction2.cs index 5d277bc..231932b 100644 --- a/MLEM/Misc/Direction2.cs +++ b/MLEM/Maths/Direction2.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Runtime.Serialization; using Microsoft.Xna.Framework; -namespace MLEM.Misc { +namespace MLEM.Maths { /// /// An enum that represents two-dimensional directions. /// Both straight and diagonal directions are supported. diff --git a/MLEM/Misc/Easings.cs b/MLEM/Maths/Easings.cs similarity index 97% rename from MLEM/Misc/Easings.cs rename to MLEM/Maths/Easings.cs index 3c83b03..a5a6d93 100644 --- a/MLEM/Misc/Easings.cs +++ b/MLEM/Maths/Easings.cs @@ -1,7 +1,7 @@ using System; using Microsoft.Xna.Framework; -namespace MLEM.Misc { +namespace MLEM.Maths { /// /// This class contains a set of easing functions, adapted from https://easings.net. /// These can be used for ui elements or any other kind of animations. @@ -11,12 +11,12 @@ namespace MLEM.Misc { /// /// An easing function that constantly returns 0, regardless of the input percentage. - /// This is useful for chaining using . + /// This is useful for chaining using . /// public static readonly Easing Zero = p => 0; /// /// An easing function that constantly returns 1, regardless of the input percentage. - /// This is useful for chaining using . + /// This is useful for chaining using . /// public static readonly Easing One = p => 1; /// @@ -160,7 +160,7 @@ namespace MLEM.Misc { /// /// Causes the easing function to play fully, followed by playing fully, in the span between an input of 0 and 1. - /// Note that provides a version of this method for any amount of follow-up easing functions. + /// Note that provides a version of this method for any amount of follow-up easing functions. /// /// The first easing function to play. /// The second easing function to play. @@ -171,7 +171,7 @@ namespace MLEM.Misc { /// /// Causes the easing function to play fully, followed by all elements of playing fully, in the span between an input of 0 and 1. - /// This is an any-amount version of . + /// This is an any-amount version of . /// /// The first easing function to play. /// The next easing functions to play. diff --git a/MLEM/Extensions/NumberExtensions.cs b/MLEM/Maths/NumberExtensions.cs similarity index 99% rename from MLEM/Extensions/NumberExtensions.cs rename to MLEM/Maths/NumberExtensions.cs index f12bfdc..21e5966 100644 --- a/MLEM/Extensions/NumberExtensions.cs +++ b/MLEM/Maths/NumberExtensions.cs @@ -1,9 +1,8 @@ using System; using System.Collections.Generic; using Microsoft.Xna.Framework; -using MLEM.Misc; -namespace MLEM.Extensions { +namespace MLEM.Maths { /// /// A set of extensions for dealing with , , , , , , and /// diff --git a/MLEM/Misc/Padding.cs b/MLEM/Maths/Padding.cs similarity index 99% rename from MLEM/Misc/Padding.cs rename to MLEM/Maths/Padding.cs index adec88c..e0e0334 100644 --- a/MLEM/Misc/Padding.cs +++ b/MLEM/Maths/Padding.cs @@ -2,7 +2,7 @@ using System; using System.Runtime.Serialization; using Microsoft.Xna.Framework; -namespace MLEM.Misc { +namespace MLEM.Maths { /// /// Represents a generic padding. /// A padding is an object of data that stores an offset from each side of a rectangle or square. diff --git a/MLEM/Extensions/RandomExtensions.cs b/MLEM/Maths/RandomExtensions.cs similarity index 99% rename from MLEM/Extensions/RandomExtensions.cs rename to MLEM/Maths/RandomExtensions.cs index b171c8c..8bebfed 100644 --- a/MLEM/Extensions/RandomExtensions.cs +++ b/MLEM/Maths/RandomExtensions.cs @@ -2,7 +2,7 @@ using System; using System.Collections.Generic; using System.Linq; -namespace MLEM.Extensions { +namespace MLEM.Maths { /// /// A set of extensions for dealing with /// diff --git a/MLEM/Misc/RectangleF.cs b/MLEM/Maths/RectangleF.cs similarity index 99% rename from MLEM/Misc/RectangleF.cs rename to MLEM/Maths/RectangleF.cs index 95890a5..e8a47bb 100644 --- a/MLEM/Misc/RectangleF.cs +++ b/MLEM/Maths/RectangleF.cs @@ -1,9 +1,8 @@ using System; using System.Runtime.Serialization; using Microsoft.Xna.Framework; -using MLEM.Extensions; -namespace MLEM.Misc { +namespace MLEM.Maths { /// /// Represents a float-based version of /// diff --git a/MLEM/Misc/SeedSource.cs b/MLEM/Maths/SeedSource.cs similarity index 99% rename from MLEM/Misc/SeedSource.cs rename to MLEM/Maths/SeedSource.cs index fb3a95c..486783a 100644 --- a/MLEM/Misc/SeedSource.cs +++ b/MLEM/Maths/SeedSource.cs @@ -1,6 +1,6 @@ using System; -namespace MLEM.Misc { +namespace MLEM.Maths { /// /// A seed source contains an value which can be used as a seed for a or . Seed sources feature a convenient way to add multiple seeds using , which will be sufficiently scrambled to be deterministically pseudorandom and combined into a single . /// This struct behaves similarly to System.HashCode in many ways, with an important distinction being that 's scrambling procedure is not considered an implementation detail, and will stay consistent between process executions. diff --git a/MLEM/Misc/SingleRandom.cs b/MLEM/Maths/SingleRandom.cs similarity index 98% rename from MLEM/Misc/SingleRandom.cs rename to MLEM/Maths/SingleRandom.cs index dc3d861..192bf1f 100644 --- a/MLEM/Misc/SingleRandom.cs +++ b/MLEM/Maths/SingleRandom.cs @@ -1,8 +1,7 @@ using System; using System.Collections.Generic; -using MLEM.Extensions; -namespace MLEM.Misc { +namespace MLEM.Maths { /// /// The SingleRandom class allows generating single, one-off pseudorandom numbers based on a seed or a . /// The types of numbers that can be generated are and , both of which can be generated with specific minimum and maximum values if desired. @@ -167,7 +166,7 @@ namespace MLEM.Misc { return RandomExtensions.GetRandomWeightedEntry(entries, weightFunc, SingleRandom.Single(source)); } - /// + /// public static T GetRandomWeightedEntry(ICollection entries, Func weightFunc, SeedSource source) { return RandomExtensions.GetRandomWeightedEntry(entries, weightFunc, SingleRandom.Single(source)); } diff --git a/MLEM/Extensions/CollectionExtensions.cs b/MLEM/Misc/CollectionExtensions.cs similarity index 99% rename from MLEM/Extensions/CollectionExtensions.cs rename to MLEM/Misc/CollectionExtensions.cs index 8f1991f..8dbf561 100644 --- a/MLEM/Extensions/CollectionExtensions.cs +++ b/MLEM/Misc/CollectionExtensions.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Linq; -namespace MLEM.Extensions { +namespace MLEM.Misc { /// /// A set of extensions for dealing with collections of various kinds /// diff --git a/MLEM/Misc/GenericDataHolder.cs b/MLEM/Misc/GenericDataHolder.cs index 8ca15ab..a8c33ba 100644 --- a/MLEM/Misc/GenericDataHolder.cs +++ b/MLEM/Misc/GenericDataHolder.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; namespace MLEM.Misc { diff --git a/MLEM/Pathfinding/AStar2.cs b/MLEM/Pathfinding/AStar2.cs index 7b92508..dcfbdae 100644 --- a/MLEM/Pathfinding/AStar2.cs +++ b/MLEM/Pathfinding/AStar2.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; using Microsoft.Xna.Framework; -using MLEM.Misc; +using MLEM.Maths; namespace MLEM.Pathfinding { /// diff --git a/MLEM/Sound/SoundEffectInfo.cs b/MLEM/Sound/SoundEffectInfo.cs index 46f3484..e3dfa06 100644 --- a/MLEM/Sound/SoundEffectInfo.cs +++ b/MLEM/Sound/SoundEffectInfo.cs @@ -1,6 +1,5 @@ using System; using Microsoft.Xna.Framework.Audio; -using MLEM.Extensions; namespace MLEM.Sound { /// diff --git a/MLEM/Extensions/SoundExtensions.cs b/MLEM/Sound/SoundExtensions.cs similarity index 98% rename from MLEM/Extensions/SoundExtensions.cs rename to MLEM/Sound/SoundExtensions.cs index 9cccf06..557d6ae 100644 --- a/MLEM/Extensions/SoundExtensions.cs +++ b/MLEM/Sound/SoundExtensions.cs @@ -1,6 +1,6 @@ using Microsoft.Xna.Framework.Audio; -namespace MLEM.Extensions { +namespace MLEM.Sound { /// /// A set of extensions for dealing with and /// diff --git a/MLEM/Textures/NinePatch.cs b/MLEM/Textures/NinePatch.cs index 827af62..3370f77 100644 --- a/MLEM/Textures/NinePatch.cs +++ b/MLEM/Textures/NinePatch.cs @@ -1,7 +1,8 @@ using System; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using MLEM.Extensions; +using MLEM.Graphics; +using MLEM.Maths; using MLEM.Misc; namespace MLEM.Textures { @@ -173,17 +174,17 @@ namespace MLEM.Textures { } } - /// + /// public static void Draw(this SpriteBatch batch, NinePatch texture, Rectangle destinationRectangle, Color color, float rotation, Vector2 origin, SpriteEffects effects, float layerDepth, float patchScale = 1) { batch.Draw(texture, (RectangleF) destinationRectangle, color, rotation, origin, effects, layerDepth, patchScale); } - /// + /// public static void Draw(this SpriteBatch batch, NinePatch texture, RectangleF destinationRectangle, Color color, float patchScale = 1) { batch.Draw(texture, destinationRectangle, color, 0, Vector2.Zero, SpriteEffects.None, 0, patchScale); } - /// + /// public static void Draw(this SpriteBatch batch, NinePatch texture, Rectangle destinationRectangle, Color color, float patchScale = 1) { batch.Draw(texture, destinationRectangle, color, 0, Vector2.Zero, SpriteEffects.None, 0, patchScale); } diff --git a/MLEM/Extensions/TextureExtensions.cs b/MLEM/Textures/TextureExtensions.cs similarity index 99% rename from MLEM/Extensions/TextureExtensions.cs rename to MLEM/Textures/TextureExtensions.cs index 9826bbb..0c58fb7 100644 --- a/MLEM/Extensions/TextureExtensions.cs +++ b/MLEM/Textures/TextureExtensions.cs @@ -2,7 +2,7 @@ using System; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -namespace MLEM.Extensions { +namespace MLEM.Textures { /// /// A set of extensions for dealing with /// diff --git a/MLEM/Textures/TextureRegion.cs b/MLEM/Textures/TextureRegion.cs index 5b3f472..17718a4 100644 --- a/MLEM/Textures/TextureRegion.cs +++ b/MLEM/Textures/TextureRegion.cs @@ -1,7 +1,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using MLEM.Extensions; using MLEM.Graphics; +using MLEM.Maths; using MLEM.Misc; namespace MLEM.Textures { diff --git a/Sandbox/GameImpl.cs b/Sandbox/GameImpl.cs index 070b216..dff401b 100644 --- a/Sandbox/GameImpl.cs +++ b/Sandbox/GameImpl.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.IO; using System.Text.RegularExpressions; using FontStashSharp; @@ -10,13 +9,11 @@ using MLEM.Cameras; using MLEM.Data; using MLEM.Data.Content; using MLEM.Extended.Font; -using MLEM.Extensions; using MLEM.Font; using MLEM.Formatting; using MLEM.Formatting.Codes; using MLEM.Graphics; -using MLEM.Input; -using MLEM.Misc; +using MLEM.Maths; using MLEM.Startup; using MLEM.Textures; using MLEM.Ui; diff --git a/Tests/CollectionTests.cs b/Tests/CollectionTests.cs index 67b08d5..bf7e61c 100644 --- a/Tests/CollectionTests.cs +++ b/Tests/CollectionTests.cs @@ -1,4 +1,4 @@ -using MLEM.Extensions; +using MLEM.Misc; using NUnit.Framework; namespace Tests; diff --git a/Tests/DataTests.cs b/Tests/DataTests.cs index 6fadd7c..631c925 100644 --- a/Tests/DataTests.cs +++ b/Tests/DataTests.cs @@ -2,7 +2,7 @@ using System; using System.IO; using Microsoft.Xna.Framework; using MLEM.Data.Json; -using MLEM.Misc; +using MLEM.Maths; using Newtonsoft.Json; using NUnit.Framework; using Vector2 = Microsoft.Xna.Framework.Vector2; diff --git a/Tests/DirectionTests.cs b/Tests/DirectionTests.cs index 43f8ffc..df5af24 100644 --- a/Tests/DirectionTests.cs +++ b/Tests/DirectionTests.cs @@ -1,5 +1,5 @@ using Microsoft.Xna.Framework; -using MLEM.Misc; +using MLEM.Maths; using NUnit.Framework; namespace Tests; diff --git a/Tests/NumberTests.cs b/Tests/NumberTests.cs index 8a9cb42..0acb02f 100644 --- a/Tests/NumberTests.cs +++ b/Tests/NumberTests.cs @@ -1,13 +1,9 @@ using Microsoft.Xna.Framework; -using MLEM.Extensions; +using MLEM.Extended.Maths; using NUnit.Framework; -using RectangleF = MLEM.Misc.RectangleF; - -#if !FNA +using RectangleF = MLEM.Maths.RectangleF; +using MLEM.Maths; using MonoGame.Extended; -using MLEM.Extended.Extensions; -#endif - namespace Tests; public class NumberTests { @@ -73,7 +69,6 @@ public class NumberTests { Assert.AreEqual(penetration, 0); } -#if !FNA [Test] public void TestRangePercentage() { Assert.AreEqual(0.5F, new Range(1, 7).GetPercentage(4)); @@ -95,6 +90,5 @@ public class NumberTests { Assert.AreEqual(11, new Range(8, 10).FromPercentage(1.5F)); Assert.AreEqual(7, new Range(8, 10).FromPercentage(-0.5F)); } -#endif } diff --git a/Tests/SingleRandomTests.cs b/Tests/SingleRandomTests.cs index 15398b5..46052b8 100644 --- a/Tests/SingleRandomTests.cs +++ b/Tests/SingleRandomTests.cs @@ -2,7 +2,7 @@ using System.Globalization; using System.IO; using System.Linq; -using MLEM.Misc; +using MLEM.Maths; using NUnit.Framework; namespace Tests; diff --git a/Tests/Tests.FNA.csproj b/Tests/Tests.FNA.csproj index ed57fb9..002d491 100644 --- a/Tests/Tests.FNA.csproj +++ b/Tests/Tests.FNA.csproj @@ -18,6 +18,7 @@ + diff --git a/Tests/TexturePackerTests.cs b/Tests/TexturePackerTests.cs index ec5f901..e7204bf 100644 --- a/Tests/TexturePackerTests.cs +++ b/Tests/TexturePackerTests.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; using Microsoft.Xna.Framework.Graphics; using MLEM.Data; using MLEM.Textures; diff --git a/Tests/UiTests.cs b/Tests/UiTests.cs index 12af85c..9aced85 100644 --- a/Tests/UiTests.cs +++ b/Tests/UiTests.cs @@ -2,7 +2,7 @@ using System.Diagnostics; using System.Linq; using Microsoft.Xna.Framework; -using MLEM.Misc; +using MLEM.Maths; using MLEM.Ui; using MLEM.Ui.Elements; using MLEM.Ui.Style;