1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-09-16 20:45:47 +02:00

Moved extension methods into matching namespaces to avoid unexpected suggestions

This commit is contained in:
Ell 2024-07-19 20:02:28 +02:00
parent 13436a31ea
commit 677230ce28
85 changed files with 130 additions and 142 deletions

View file

@ -24,6 +24,7 @@ Additions
Improvements Improvements
- **Made the Keybind.Combinations collection a public property** - **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 NumberExtensions.GetPoints to include bottom and right coordinates
- Allow AutoTiling overlayTextures to return null texture regions - Allow AutoTiling overlayTextures to return null texture regions
@ -56,9 +57,13 @@ Removals
### MLEM.Extended ### MLEM.Extended
Improvements Improvements
- **Added compatibility for MonoGame.Extended 4.0.0** - **Added compatibility for MonoGame.Extended 4.0.0**
- **Moved extension methods into matching namespaces to avoid unexpected suggestions**
- Added compatibility for FNA.Extended - Added compatibility for FNA.Extended
### MLEM.Data ### MLEM.Data
Improvements
- **Moved extension methods into matching namespaces to avoid unexpected suggestions**
Removals Removals
- **Removed obsolete types DynamicEnumConverter, CopyExtensions, DynamicEnum, NetBufferSerializer, and NetExtensions** - **Removed obsolete types DynamicEnumConverter, CopyExtensions, DynamicEnum, NetBufferSerializer, and NetExtensions**

View file

@ -5,7 +5,7 @@ using Android.OS;
using Android.Views; using Android.Views;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Input;
using MLEM.Extensions; using MLEM.Graphics;
using MLEM.Misc; using MLEM.Misc;
using Uri = Android.Net.Uri; using Uri = Android.Net.Uri;

View file

@ -2,7 +2,7 @@ using System;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using MLEM.Animations; using MLEM.Animations;
using MLEM.Misc; using MLEM.Maths;
using MLEM.Startup; using MLEM.Startup;
using MLEM.Textures; using MLEM.Textures;
using MLEM.Ui; using MLEM.Ui;

View file

@ -1,7 +1,7 @@
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using MLEM.Extensions;
using MLEM.Graphics; using MLEM.Graphics;
using MLEM.Maths;
using MLEM.Startup; using MLEM.Startup;
using MLEM.Textures; using MLEM.Textures;

View file

@ -2,8 +2,8 @@ using System.Linq;
using System.Reflection; using System.Reflection;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using MLEM.Extensions; using MLEM.Graphics;
using MLEM.Misc; using MLEM.Maths;
using MLEM.Startup; using MLEM.Startup;
using MLEM.Ui; using MLEM.Ui;
using MLEM.Ui.Elements; using MLEM.Ui.Elements;

View file

@ -4,8 +4,8 @@ using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using MLEM.Extensions; using MLEM.Graphics;
using MLEM.Misc; using MLEM.Maths;
using MLEM.Pathfinding; using MLEM.Pathfinding;
using MLEM.Startup; using MLEM.Startup;
using MLEM.Ui; using MLEM.Ui;

View file

@ -2,11 +2,11 @@
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Input;
using MLEM.Extensions;
using MLEM.Font; using MLEM.Font;
using MLEM.Formatting; using MLEM.Formatting;
using MLEM.Formatting.Codes; using MLEM.Formatting.Codes;
using MLEM.Misc; using MLEM.Graphics;
using MLEM.Maths;
using MLEM.Startup; using MLEM.Startup;
using MLEM.Textures; using MLEM.Textures;

View file

@ -5,11 +5,10 @@ using System.Linq;
using Coroutine; using Coroutine;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using MLEM.Extensions;
using MLEM.Font; using MLEM.Font;
using MLEM.Formatting; using MLEM.Formatting;
using MLEM.Input; using MLEM.Input;
using MLEM.Misc; using MLEM.Maths;
using MLEM.Startup; using MLEM.Startup;
using MLEM.Textures; using MLEM.Textures;
using MLEM.Ui; using MLEM.Ui;

View file

@ -5,7 +5,7 @@ using Microsoft.Xna.Framework.Content;
using MLEM.Data.Json; using MLEM.Data.Json;
using Newtonsoft.Json; using Newtonsoft.Json;
namespace MLEM.Data { namespace MLEM.Data.Content {
/// <summary> /// <summary>
/// A set of extensions for dealing with <see cref="ContentManager"/> /// A set of extensions for dealing with <see cref="ContentManager"/>
/// </summary> /// </summary>

View file

@ -1,7 +1,7 @@
using System.IO; using System.IO;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using MLEM.Extensions; using MLEM.Textures;
namespace MLEM.Data.Content { namespace MLEM.Data.Content {
/// <inheritdoc /> /// <inheritdoc />

View file

@ -6,7 +6,7 @@ using System.Text.RegularExpressions;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using MLEM.Extensions; using MLEM.Maths;
using MLEM.Misc; using MLEM.Misc;
using MLEM.Textures; using MLEM.Textures;

View file

@ -1,5 +1,5 @@
using System; using System;
using MLEM.Misc; using MLEM.Maths;
using Newtonsoft.Json; using Newtonsoft.Json;
namespace MLEM.Data.Json { namespace MLEM.Data.Json {

View file

@ -1,5 +1,3 @@
using System;
using System.Linq;
using Newtonsoft.Json; using Newtonsoft.Json;
namespace MLEM.Data.Json { namespace MLEM.Data.Json {

View file

@ -1,5 +1,4 @@
using System; using System.Collections.Generic;
using System.Collections.Generic;
using MLEM.Misc; using MLEM.Misc;
using Newtonsoft.Json; using Newtonsoft.Json;

View file

@ -1,6 +1,6 @@
using System; using System;
using System.Globalization; using System.Globalization;
using MLEM.Misc; using MLEM.Maths;
using Newtonsoft.Json; using Newtonsoft.Json;
namespace MLEM.Data.Json { namespace MLEM.Data.Json {

View file

@ -4,9 +4,9 @@ using System.Diagnostics;
using System.Linq; using System.Linq;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using MLEM.Extensions; using MLEM.Maths;
using MLEM.Textures; using MLEM.Textures;
using static MLEM.Extensions.TextureExtensions; using static MLEM.Textures.TextureExtensions;
namespace MLEM.Data { namespace MLEM.Data {
/// <summary> /// <summary>

View file

@ -1,10 +1,12 @@
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using MLEM.Extensions; using MLEM.Extended.Maths;
using MLEM.Graphics;
using MLEM.Maths;
using ShapeExtensions = MonoGame.Extended.ShapeExtensions; using ShapeExtensions = MonoGame.Extended.ShapeExtensions;
using RectangleF = MonoGame.Extended.RectangleF; using RectangleF = MonoGame.Extended.RectangleF;
namespace MLEM.Extended.Extensions { namespace MLEM.Extended.Graphics {
/// <summary> /// <summary>
/// A set of extension methods for dealing with <see cref="SpriteBatch"/> and <see cref="RectangleF"/> in combination. /// A set of extension methods for dealing with <see cref="SpriteBatch"/> and <see cref="RectangleF"/> in combination.
/// </summary> /// </summary>

View file

@ -1,10 +1,10 @@
using MLEM.Extensions; using MLEM.Maths;
using MLEM.Textures; using MLEM.Textures;
using MonoGame.Extended.Graphics; using MonoGame.Extended.Graphics;
using NinePatch = MLEM.Textures.NinePatch; using NinePatch = MLEM.Textures.NinePatch;
using ExtNinePatch = MonoGame.Extended.Graphics.NinePatch; using ExtNinePatch = MonoGame.Extended.Graphics.NinePatch;
namespace MLEM.Extended.Extensions { namespace MLEM.Extended.Graphics {
/// <summary> /// <summary>
/// A set of extensions for converting texture-related types between MLEM and MonoGame.Extended. /// A set of extensions for converting texture-related types between MLEM and MonoGame.Extended.
/// </summary> /// </summary>

View file

@ -37,7 +37,10 @@
<ItemGroup Condition="'$(TargetFramework)'!='net8.0'"> <ItemGroup Condition="'$(TargetFramework)'!='net8.0'">
<Compile Remove="Tiled/**" /> <Compile Remove="Tiled/**" />
<Compile Remove="Extensions/**" /> <Compile Remove="Graphics/SpriteBatchExtensions.cs" />
<Compile Remove="Graphics/TextureExtensions.cs" />
<Compile Remove="Maths/NumberExtensions.cs" />
<Compile Remove="Maths/RandomExtensions.cs" />
<Compile Remove="Font/GenericBitmapFont.cs" /> <Compile Remove="Font/GenericBitmapFont.cs" />
</ItemGroup> </ItemGroup>

View file

@ -34,7 +34,10 @@
<ItemGroup Condition="'$(TargetFramework)'!='net8.0'"> <ItemGroup Condition="'$(TargetFramework)'!='net8.0'">
<Compile Remove="Tiled/**" /> <Compile Remove="Tiled/**" />
<Compile Remove="Extensions/**" /> <Compile Remove="Graphics/SpriteBatchExtensions.cs" />
<Compile Remove="Graphics/TextureExtensions.cs" />
<Compile Remove="Maths/NumberExtensions.cs" />
<Compile Remove="Maths/RandomExtensions.cs" />
<Compile Remove="Font/GenericBitmapFont.cs" /> <Compile Remove="Font/GenericBitmapFont.cs" />
</ItemGroup> </ItemGroup>

View file

@ -1,29 +1,31 @@
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using MLEM.Extensions; using MLEM.Maths;
using MonoGame.Extended; using MonoGame.Extended;
using MlemRectangleF = MLEM.Maths.RectangleF;
using ExtRectangleF = MonoGame.Extended.RectangleF;
namespace MLEM.Extended.Extensions { namespace MLEM.Extended.Maths {
/// <summary> /// <summary>
/// A set of extension methods that convert MLEM types to MonoGame.Extended types and vice versa. /// A set of extension methods that convert MLEM types to MonoGame.Extended types and vice versa.
/// </summary> /// </summary>
public static class NumberExtensions { public static class NumberExtensions {
/// <summary> /// <summary>
/// Converts a MLEM <see cref="Misc.RectangleF"/> to a MonoGame.Extended <see cref="RectangleF"/>. /// Converts a MLEM <see cref="MlemRectangleF"/> to a MonoGame.Extended <see cref="ExtRectangleF"/>.
/// </summary> /// </summary>
/// <param name="rect">The rectangle to convert</param> /// <param name="rect">The rectangle to convert</param>
/// <returns>The converted rectangle</returns> /// <returns>The converted rectangle</returns>
public static RectangleF ToExtended(this Misc.RectangleF rect) { public static ExtRectangleF ToExtended(this MlemRectangleF rect) {
return new RectangleF(rect.X, rect.Y, rect.Width, rect.Height); return new ExtRectangleF(rect.X, rect.Y, rect.Width, rect.Height);
} }
/// <summary> /// <summary>
/// Converts a MonoGame.Extended <see cref="RectangleF"/> to a MLEM <see cref="Misc.RectangleF"/>. /// Converts a MonoGame.Extended <see cref="ExtRectangleF"/> to a MLEM <see cref="MlemRectangleF"/>.
/// </summary> /// </summary>
/// <param name="rect">The rectangle to convert</param> /// <param name="rect">The rectangle to convert</param>
/// <returns>The converted rectangle</returns> /// <returns>The converted rectangle</returns>
public static Misc.RectangleF ToMlem(this RectangleF rect) { public static MlemRectangleF ToMlem(this ExtRectangleF rect) {
return new Misc.RectangleF(rect.X, rect.Y, rect.Width, rect.Height); return new MlemRectangleF(rect.X, rect.Y, rect.Width, rect.Height);
} }
/// <summary> /// <summary>
@ -36,7 +38,7 @@ namespace MLEM.Extended.Extensions {
/// <param name="normal">The direction that the penetration occured in</param> /// <param name="normal">The direction that the penetration occured in</param>
/// <param name="penetration">The amount that the penetration occured by, in the direction of <paramref name="normal"/></param> /// <param name="penetration">The amount that the penetration occured by, in the direction of <paramref name="normal"/></param>
/// <returns>Whether or not a penetration occured</returns> /// <returns>Whether or not a penetration occured</returns>
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); return rect.ToMlem().Penetrate(other.ToMlem(), out normal, out penetration);
} }

View file

@ -2,7 +2,7 @@ using System;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using MonoGame.Extended; using MonoGame.Extended;
namespace MLEM.Extended.Extensions { namespace MLEM.Extended.Maths {
/// <summary> /// <summary>
/// A set of extension methods for dealing with <see cref="Random"/> /// A set of extension methods for dealing with <see cref="Random"/>
/// </summary> /// </summary>

View file

@ -3,8 +3,8 @@ using System.Collections.Generic;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using MLEM.Cameras; using MLEM.Cameras;
using MLEM.Extensions;
using MLEM.Graphics; using MLEM.Graphics;
using MLEM.Maths;
using MLEM.Misc; using MLEM.Misc;
using MonoGame.Extended.Tiled; using MonoGame.Extended.Tiled;
using RectangleF = MonoGame.Extended.RectangleF; using RectangleF = MonoGame.Extended.RectangleF;

View file

@ -5,7 +5,7 @@ using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using MonoGame.Extended; using MonoGame.Extended;
using MonoGame.Extended.Tiled; using MonoGame.Extended.Tiled;
using ColorHelper = MLEM.Extensions.ColorHelper; using ColorHelper = MLEM.Graphics.ColorHelper;
namespace MLEM.Extended.Tiled { namespace MLEM.Extended.Tiled {
/// <summary> /// <summary>

View file

@ -2,8 +2,8 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using MLEM.Extended.Extensions; using MLEM.Extended.Maths;
using MLEM.Extensions; using MLEM.Maths;
using MLEM.Misc; using MLEM.Misc;
using MonoGame.Extended.Tiled; using MonoGame.Extended.Tiled;
using RectangleF = MonoGame.Extended.RectangleF; using RectangleF = MonoGame.Extended.RectangleF;
@ -125,7 +125,7 @@ namespace MLEM.Extended.Tiled {
/// <summary> /// <summary>
/// Returns an enumerable of normals and penetration amounts for each <see cref="TileCollisionInfo"/> that intersects with the given <see cref="RectangleF"/> area. /// Returns an enumerable of normals and penetration amounts for each <see cref="TileCollisionInfo"/> that intersects with the given <see cref="RectangleF"/> area.
/// The normals and penetration amounts are based on <see cref="MLEM.Extensions.NumberExtensions.Penetrate"/>. /// The normals and penetration amounts are based on <see cref="MLEM.Maths.NumberExtensions.Penetrate"/>.
/// 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 <paramref name="prioritizeX"/>. /// 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 <paramref name="prioritizeX"/>.
/// </summary> /// </summary>
/// <param name="getArea">The area to penetrate</param> /// <param name="getArea">The area to penetrate</param>

View file

@ -2,7 +2,7 @@ using System;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using MLEM.Graphics; using MLEM.Graphics;
using MLEM.Misc; using MLEM.Maths;
using MLEM.Textures; using MLEM.Textures;
using MLEM.Ui.Style; using MLEM.Ui.Style;

View file

@ -1,7 +1,7 @@
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using MLEM.Graphics; using MLEM.Graphics;
using MLEM.Misc; using MLEM.Maths;
using MLEM.Textures; using MLEM.Textures;
using MLEM.Ui.Style; using MLEM.Ui.Style;

View file

@ -1,6 +1,6 @@
using System.Linq; using System.Linq;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using MLEM.Misc; using MLEM.Maths;
namespace MLEM.Ui.Elements { namespace MLEM.Ui.Elements {
/// <summary> /// <summary>

View file

@ -6,9 +6,9 @@ using System.Linq;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Input;
using MLEM.Extensions;
using MLEM.Graphics; using MLEM.Graphics;
using MLEM.Input; using MLEM.Input;
using MLEM.Maths;
using MLEM.Misc; using MLEM.Misc;
using MLEM.Sound; using MLEM.Sound;
using MLEM.Textures; using MLEM.Textures;

View file

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using MLEM.Input; using MLEM.Input;
using MLEM.Maths;
using MLEM.Misc; using MLEM.Misc;
using MLEM.Textures; using MLEM.Textures;

View file

@ -2,12 +2,9 @@ using System;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using MLEM.Graphics; using MLEM.Graphics;
using MLEM.Misc; using MLEM.Maths;
using MLEM.Textures; using MLEM.Textures;
using MLEM.Ui.Style; using MLEM.Ui.Style;
#if FNA
using MLEM.Extensions;
#endif
namespace MLEM.Ui.Elements { namespace MLEM.Ui.Elements {
/// <summary> /// <summary>

View file

@ -3,9 +3,8 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using MLEM.Extensions;
using MLEM.Graphics; using MLEM.Graphics;
using MLEM.Misc; using MLEM.Maths;
using MLEM.Textures; using MLEM.Textures;
using MLEM.Ui.Style; using MLEM.Ui.Style;

View file

@ -2,11 +2,11 @@ using System;
using System.Linq; using System.Linq;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using MLEM.Extensions;
using MLEM.Font; using MLEM.Font;
using MLEM.Formatting; using MLEM.Formatting;
using MLEM.Formatting.Codes; using MLEM.Formatting.Codes;
using MLEM.Graphics; using MLEM.Graphics;
using MLEM.Maths;
using MLEM.Misc; using MLEM.Misc;
using MLEM.Ui.Style; using MLEM.Ui.Style;

View file

@ -1,9 +1,8 @@
using System; using System;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using MLEM.Extensions;
using MLEM.Graphics; using MLEM.Graphics;
using MLEM.Misc; using MLEM.Maths;
using MLEM.Textures; using MLEM.Textures;
using MLEM.Ui.Style; using MLEM.Ui.Style;

View file

@ -1,7 +1,7 @@
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using MLEM.Extensions;
using MLEM.Graphics; using MLEM.Graphics;
using MLEM.Maths;
namespace MLEM.Ui.Elements { namespace MLEM.Ui.Elements {
/// <summary> /// <summary>

View file

@ -5,12 +5,9 @@ using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input.Touch; using Microsoft.Xna.Framework.Input.Touch;
using MLEM.Graphics; using MLEM.Graphics;
using MLEM.Input; using MLEM.Input;
using MLEM.Misc; using MLEM.Maths;
using MLEM.Textures; using MLEM.Textures;
using MLEM.Ui.Style; using MLEM.Ui.Style;
#if FNA
using MLEM.Extensions;
#endif
namespace MLEM.Ui.Elements { namespace MLEM.Ui.Elements {
/// <summary> /// <summary>

View file

@ -1,5 +1,5 @@
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using MLEM.Misc; using MLEM.Maths;
namespace MLEM.Ui.Elements { namespace MLEM.Ui.Elements {
/// <summary> /// <summary>

View file

@ -1,8 +1,7 @@
using System; using System;
using System.Linq; using System.Linq;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using MLEM.Extensions; using MLEM.Maths;
using MLEM.Misc;
namespace MLEM.Ui.Elements { namespace MLEM.Ui.Elements {
/// <summary> /// <summary>

View file

@ -5,6 +5,7 @@ using Microsoft.Xna.Framework.Input;
using MLEM.Font; using MLEM.Font;
using MLEM.Graphics; using MLEM.Graphics;
using MLEM.Input; using MLEM.Input;
using MLEM.Maths;
using MLEM.Misc; using MLEM.Misc;
using MLEM.Textures; using MLEM.Textures;
using MLEM.Ui.Style; using MLEM.Ui.Style;

View file

@ -1,13 +1,12 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using MLEM.Input; using MLEM.Input;
using MLEM.Ui.Style; using MLEM.Ui.Style;
using Color = Microsoft.Xna.Framework.Color; using Color = Microsoft.Xna.Framework.Color;
using RectangleF = MLEM.Misc.RectangleF; using RectangleF = MLEM.Maths.RectangleF;
#if FNA #if FNA
using MLEM.Extensions; using MLEM.Maths;
#endif #endif
namespace MLEM.Ui.Elements { namespace MLEM.Ui.Elements {

View file

@ -4,6 +4,7 @@ using Microsoft.Xna.Framework;
using MLEM.Font; using MLEM.Font;
using MLEM.Formatting; using MLEM.Formatting;
using MLEM.Formatting.Codes; using MLEM.Formatting.Codes;
using MLEM.Maths;
using MLEM.Misc; using MLEM.Misc;
using MLEM.Sound; using MLEM.Sound;
using MLEM.Textures; using MLEM.Textures;

View file

@ -1,6 +1,6 @@
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using MLEM.Extensions; using MLEM.Graphics;
namespace MLEM.Ui.Style { namespace MLEM.Ui.Style {
/// <summary> /// <summary>

View file

@ -5,12 +5,12 @@ using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Input.Touch; using Microsoft.Xna.Framework.Input.Touch;
using MLEM.Input; using MLEM.Input;
using MLEM.Maths;
using MLEM.Misc; using MLEM.Misc;
using MLEM.Ui.Elements; using MLEM.Ui.Elements;
using MLEM.Ui.Style; using MLEM.Ui.Style;
#if NET452 #if NET452
using MLEM.Extensions;
#endif #endif
namespace MLEM.Ui { namespace MLEM.Ui {

View file

@ -1,8 +1,7 @@
using System; using System;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using MLEM.Extensions; using MLEM.Maths;
using MLEM.Misc;
namespace MLEM.Cameras { namespace MLEM.Cameras {
/// <summary> /// <summary>

View file

@ -1,4 +1,3 @@
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;

View file

@ -2,9 +2,9 @@ using System.Text.RegularExpressions;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using MLEM.Animations; using MLEM.Animations;
using MLEM.Extensions;
using MLEM.Font; using MLEM.Font;
using MLEM.Misc; using MLEM.Graphics;
using MLEM.Maths;
using MLEM.Textures; using MLEM.Textures;
namespace MLEM.Formatting.Codes { namespace MLEM.Formatting.Codes {

View file

@ -1,10 +1,9 @@
using System; using System.Text.RegularExpressions;
using System.Text.RegularExpressions;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using MLEM.Extensions;
using MLEM.Font; using MLEM.Font;
using MLEM.Misc; using MLEM.Graphics;
using MLEM.Maths;
namespace MLEM.Formatting.Codes { namespace MLEM.Formatting.Codes {
/// <inheritdoc /> /// <inheritdoc />

View file

@ -1,8 +1,8 @@
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using MLEM.Extensions;
using MLEM.Font; using MLEM.Font;
using MLEM.Graphics;
namespace MLEM.Formatting.Codes { namespace MLEM.Formatting.Codes {
/// <inheritdoc /> /// <inheritdoc />

View file

@ -1,9 +1,9 @@
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using MLEM.Extensions;
using MLEM.Font; using MLEM.Font;
using MLEM.Misc; using MLEM.Graphics;
using MLEM.Maths;
namespace MLEM.Formatting.Codes { namespace MLEM.Formatting.Codes {
/// <inheritdoc /> /// <inheritdoc />

View file

@ -4,9 +4,9 @@ using System.Globalization;
using System.Linq; using System.Linq;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using MLEM.Extensions;
using MLEM.Font; using MLEM.Font;
using MLEM.Formatting.Codes; using MLEM.Formatting.Codes;
using MLEM.Graphics;
using MLEM.Misc; using MLEM.Misc;
namespace MLEM.Formatting { namespace MLEM.Formatting {

View file

@ -5,6 +5,7 @@ using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using MLEM.Font; using MLEM.Font;
using MLEM.Formatting.Codes; using MLEM.Formatting.Codes;
using MLEM.Maths;
using MLEM.Misc; using MLEM.Misc;
namespace MLEM.Formatting { namespace MLEM.Formatting {

View file

@ -1,4 +1,3 @@
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
@ -6,6 +5,7 @@ using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using MLEM.Font; using MLEM.Font;
using MLEM.Formatting.Codes; using MLEM.Formatting.Codes;
using MLEM.Maths;
using MLEM.Misc; using MLEM.Misc;
namespace MLEM.Formatting { namespace MLEM.Formatting {

View file

@ -2,7 +2,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using MLEM.Misc; using MLEM.Maths;
using MLEM.Textures; using MLEM.Textures;
namespace MLEM.Graphics { namespace MLEM.Graphics {
@ -128,7 +128,7 @@ namespace MLEM.Graphics {
AutoTiling.DrawExtendedAutoTileCorner(batch, pos, overlayTextures, connectsTo, overlayColor, Direction2.DownRight, origin, scale, od); AutoTiling.DrawExtendedAutoTileCorner(batch, pos, overlayTextures, connectsTo, overlayColor, Direction2.DownRight, origin, scale, od);
} }
/// <inheritdoc cref="DrawExtendedAutoTileCorner(Microsoft.Xna.Framework.Graphics.SpriteBatch,Microsoft.Xna.Framework.Vector2,MLEM.Textures.TextureRegion,MLEM.Graphics.AutoTiling.ConnectsTo,Microsoft.Xna.Framework.Color,MLEM.Misc.Direction2,System.Nullable{Microsoft.Xna.Framework.Vector2},System.Nullable{Microsoft.Xna.Framework.Vector2},float)"/> /// <inheritdoc cref="DrawExtendedAutoTileCorner(Microsoft.Xna.Framework.Graphics.SpriteBatch,Microsoft.Xna.Framework.Vector2,MLEM.Textures.TextureRegion,MLEM.Graphics.AutoTiling.ConnectsTo,Microsoft.Xna.Framework.Color,Direction2,System.Nullable{Microsoft.Xna.Framework.Vector2},System.Nullable{Microsoft.Xna.Framework.Vector2},float)"/>
public static void DrawExtendedAutoTileCorner(SpriteBatch batch, Vector2 pos, Func<int, TextureRegion> overlayTextures, ConnectsTo connectsTo, Color overlayColor, Direction2 corner, Vector2? origin = null, Vector2? scale = null, float layerDepth = 0) { public static void DrawExtendedAutoTileCorner(SpriteBatch batch, Vector2 pos, Func<int, TextureRegion> overlayTextures, ConnectsTo connectsTo, Color overlayColor, Direction2 corner, Vector2? origin = null, Vector2? scale = null, float layerDepth = 0) {
var src = AutoTiling.CalculateExtendedAutoTileOffset(connectsTo, corner); var src = AutoTiling.CalculateExtendedAutoTileOffset(connectsTo, corner);
if (src >= 0) { if (src >= 0) {
@ -151,7 +151,7 @@ namespace MLEM.Graphics {
AutoTiling.AddExtendedAutoTileCorner(batch, pos, overlayTexture, connectsTo, overlayColor, Direction2.DownRight, origin, scale, od, items); AutoTiling.AddExtendedAutoTileCorner(batch, pos, overlayTexture, connectsTo, overlayColor, Direction2.DownRight, origin, scale, od, items);
} }
/// <inheritdoc cref="DrawExtendedAutoTileCorner(Microsoft.Xna.Framework.Graphics.SpriteBatch,Microsoft.Xna.Framework.Vector2,MLEM.Textures.TextureRegion,MLEM.Graphics.AutoTiling.ConnectsTo,Microsoft.Xna.Framework.Color,MLEM.Misc.Direction2,System.Nullable{Microsoft.Xna.Framework.Vector2},System.Nullable{Microsoft.Xna.Framework.Vector2},float)"/> /// <inheritdoc cref="DrawExtendedAutoTileCorner(Microsoft.Xna.Framework.Graphics.SpriteBatch,Microsoft.Xna.Framework.Vector2,MLEM.Textures.TextureRegion,MLEM.Graphics.AutoTiling.ConnectsTo,Microsoft.Xna.Framework.Color,Direction2,System.Nullable{Microsoft.Xna.Framework.Vector2},System.Nullable{Microsoft.Xna.Framework.Vector2},float)"/>
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<StaticSpriteBatch.Item> items = null) { 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<StaticSpriteBatch.Item> items = null) {
var src = AutoTiling.CalculateExtendedAutoTile(overlayTexture.Area, connectsTo, corner); var src = AutoTiling.CalculateExtendedAutoTile(overlayTexture.Area, connectsTo, corner);
if (src != Rectangle.Empty) { if (src != Rectangle.Empty) {
@ -173,7 +173,7 @@ namespace MLEM.Graphics {
AutoTiling.AddExtendedAutoTileCorner(batch, pos, overlayTextures, connectsTo, overlayColor, Direction2.DownRight, origin, scale, od, items); AutoTiling.AddExtendedAutoTileCorner(batch, pos, overlayTextures, connectsTo, overlayColor, Direction2.DownRight, origin, scale, od, items);
} }
/// <inheritdoc cref="DrawExtendedAutoTileCorner(Microsoft.Xna.Framework.Graphics.SpriteBatch,Microsoft.Xna.Framework.Vector2,MLEM.Textures.TextureRegion,MLEM.Graphics.AutoTiling.ConnectsTo,Microsoft.Xna.Framework.Color,MLEM.Misc.Direction2,System.Nullable{Microsoft.Xna.Framework.Vector2},System.Nullable{Microsoft.Xna.Framework.Vector2},float)"/> /// <inheritdoc cref="DrawExtendedAutoTileCorner(Microsoft.Xna.Framework.Graphics.SpriteBatch,Microsoft.Xna.Framework.Vector2,MLEM.Textures.TextureRegion,MLEM.Graphics.AutoTiling.ConnectsTo,Microsoft.Xna.Framework.Color,Direction2,System.Nullable{Microsoft.Xna.Framework.Vector2},System.Nullable{Microsoft.Xna.Framework.Vector2},float)"/>
public static void AddExtendedAutoTileCorner(StaticSpriteBatch batch, Vector2 pos, Func<int, TextureRegion> overlayTextures, ConnectsTo connectsTo, Color overlayColor, Direction2 corner, Vector2? origin = null, Vector2? scale = null, float layerDepth = 0, ICollection<StaticSpriteBatch.Item> items = null) { public static void AddExtendedAutoTileCorner(StaticSpriteBatch batch, Vector2 pos, Func<int, TextureRegion> overlayTextures, ConnectsTo connectsTo, Color overlayColor, Direction2 corner, Vector2? origin = null, Vector2? scale = null, float layerDepth = 0, ICollection<StaticSpriteBatch.Item> items = null) {
var src = AutoTiling.CalculateExtendedAutoTileOffset(connectsTo, corner); var src = AutoTiling.CalculateExtendedAutoTileOffset(connectsTo, corner);
if (src >= 0) { if (src >= 0) {

View file

@ -2,7 +2,7 @@ using System;
using System.Globalization; using System.Globalization;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
namespace MLEM.Extensions { namespace MLEM.Graphics {
/// <summary> /// <summary>
/// A set of extensions for dealing with <see cref="Color"/> objects. /// A set of extensions for dealing with <see cref="Color"/> objects.
/// </summary> /// </summary>

View file

@ -2,7 +2,7 @@ using System;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
namespace MLEM.Extensions { namespace MLEM.Graphics {
/// <summary> /// <summary>
/// A set of extensions for dealing with <see cref="GraphicsDevice"/> and <see cref="GraphicsDeviceManager"/> /// A set of extensions for dealing with <see cref="GraphicsDevice"/> and <see cref="GraphicsDeviceManager"/>
/// </summary> /// </summary>

View file

@ -1,10 +1,9 @@
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using MLEM.Graphics; using MLEM.Maths;
using MLEM.Misc;
using MLEM.Textures; using MLEM.Textures;
namespace MLEM.Extensions { namespace MLEM.Graphics {
/// <summary> /// <summary>
/// A set of extensions for dealing with <see cref="SpriteBatch"/> /// A set of extensions for dealing with <see cref="SpriteBatch"/>
/// </summary> /// </summary>

View file

@ -4,7 +4,7 @@ using System.Linq;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
#if FNA #if FNA
using MLEM.Extensions; using MLEM.Maths;
using System.IO; using System.IO;
#endif #endif

View file

@ -4,7 +4,7 @@ using System.Linq;
using System.Runtime.Serialization; using System.Runtime.Serialization;
#if NET452 #if NET452
using MLEM.Extensions; using MLEM.Misc;
#endif #endif
namespace MLEM.Input { namespace MLEM.Input {

View file

@ -1,4 +1,3 @@
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Input;

View file

@ -5,8 +5,9 @@ using System.Text;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Input;
using MLEM.Extensions;
using MLEM.Font; using MLEM.Font;
using MLEM.Graphics;
using MLEM.Maths;
using MLEM.Misc; using MLEM.Misc;
namespace MLEM.Input { namespace MLEM.Input {

View file

@ -4,7 +4,7 @@ using System.Linq;
using System.Runtime.Serialization; using System.Runtime.Serialization;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
namespace MLEM.Misc { namespace MLEM.Maths {
/// <summary> /// <summary>
/// An enum that represents two-dimensional directions. /// An enum that represents two-dimensional directions.
/// Both straight and diagonal directions are supported. /// Both straight and diagonal directions are supported.

View file

@ -1,7 +1,7 @@
using System; using System;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
namespace MLEM.Misc { namespace MLEM.Maths {
/// <summary> /// <summary>
/// This class contains a set of easing functions, adapted from https://easings.net. /// 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. /// These can be used for ui elements or any other kind of animations.
@ -11,12 +11,12 @@ namespace MLEM.Misc {
/// <summary> /// <summary>
/// An easing function that constantly returns 0, regardless of the input percentage. /// An easing function that constantly returns 0, regardless of the input percentage.
/// This is useful for chaining using <see cref="AndThen(MLEM.Misc.Easings.Easing,MLEM.Misc.Easings.Easing)"/>. /// This is useful for chaining using <see cref="AndThen(MLEM.Maths.Easings.Easing,MLEM.Maths.Easings.Easing)"/>.
/// </summary> /// </summary>
public static readonly Easing Zero = p => 0; public static readonly Easing Zero = p => 0;
/// <summary> /// <summary>
/// An easing function that constantly returns 1, regardless of the input percentage. /// An easing function that constantly returns 1, regardless of the input percentage.
/// This is useful for chaining using <see cref="AndThen(MLEM.Misc.Easings.Easing,MLEM.Misc.Easings.Easing)"/>. /// This is useful for chaining using <see cref="AndThen(MLEM.Maths.Easings.Easing,MLEM.Maths.Easings.Easing)"/>.
/// </summary> /// </summary>
public static readonly Easing One = p => 1; public static readonly Easing One = p => 1;
/// <summary> /// <summary>
@ -160,7 +160,7 @@ namespace MLEM.Misc {
/// <summary> /// <summary>
/// Causes the easing function to play fully, followed by <paramref name="other"/> playing fully, in the span between an input of 0 and 1. /// Causes the easing function to play fully, followed by <paramref name="other"/> playing fully, in the span between an input of 0 and 1.
/// Note that <see cref="AndThen(MLEM.Misc.Easings.Easing,MLEM.Misc.Easings.Easing[])"/> provides a version of this method for any amount of follow-up easing functions. /// Note that <see cref="AndThen(MLEM.Maths.Easings.Easing,MLEM.Maths.Easings.Easing[])"/> provides a version of this method for any amount of follow-up easing functions.
/// </summary> /// </summary>
/// <param name="easing">The first easing function to play.</param> /// <param name="easing">The first easing function to play.</param>
/// <param name="other">The second easing function to play.</param> /// <param name="other">The second easing function to play.</param>
@ -171,7 +171,7 @@ namespace MLEM.Misc {
/// <summary> /// <summary>
/// Causes the easing function to play fully, followed by all elements of <paramref name="others"/> playing fully, in the span between an input of 0 and 1. /// Causes the easing function to play fully, followed by all elements of <paramref name="others"/> playing fully, in the span between an input of 0 and 1.
/// This is an any-amount version of <see cref="AndThen(MLEM.Misc.Easings.Easing,MLEM.Misc.Easings.Easing)"/>. /// This is an any-amount version of <see cref="AndThen(MLEM.Maths.Easings.Easing,MLEM.Maths.Easings.Easing)"/>.
/// </summary> /// </summary>
/// <param name="easing">The first easing function to play.</param> /// <param name="easing">The first easing function to play.</param>
/// <param name="others">The next easing functions to play.</param> /// <param name="others">The next easing functions to play.</param>

View file

@ -1,9 +1,8 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using MLEM.Misc;
namespace MLEM.Extensions { namespace MLEM.Maths {
/// <summary> /// <summary>
/// A set of extensions for dealing with <see cref="float"/>, <see cref="Vector2"/>, <see cref="Vector3"/>, <see cref="Vector4"/>, <see cref="Point"/>, <see cref="Matrix"/>, <see cref="Rectangle"/> and <see cref="RectangleF"/> /// A set of extensions for dealing with <see cref="float"/>, <see cref="Vector2"/>, <see cref="Vector3"/>, <see cref="Vector4"/>, <see cref="Point"/>, <see cref="Matrix"/>, <see cref="Rectangle"/> and <see cref="RectangleF"/>
/// </summary> /// </summary>

View file

@ -2,7 +2,7 @@ using System;
using System.Runtime.Serialization; using System.Runtime.Serialization;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
namespace MLEM.Misc { namespace MLEM.Maths {
/// <summary> /// <summary>
/// Represents a generic padding. /// Represents a generic padding.
/// A padding is an object of data that stores an offset from each side of a rectangle or square. /// A padding is an object of data that stores an offset from each side of a rectangle or square.

View file

@ -2,7 +2,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
namespace MLEM.Extensions { namespace MLEM.Maths {
/// <summary> /// <summary>
/// A set of extensions for dealing with <see cref="Random"/> /// A set of extensions for dealing with <see cref="Random"/>
/// </summary> /// </summary>

View file

@ -1,9 +1,8 @@
using System; using System;
using System.Runtime.Serialization; using System.Runtime.Serialization;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using MLEM.Extensions;
namespace MLEM.Misc { namespace MLEM.Maths {
/// <summary> /// <summary>
/// Represents a float-based version of <see cref="Rectangle"/> /// Represents a float-based version of <see cref="Rectangle"/>
/// </summary> /// </summary>

View file

@ -1,6 +1,6 @@
using System; using System;
namespace MLEM.Misc { namespace MLEM.Maths {
/// <summary> /// <summary>
/// A seed source contains an <see cref="int"/> value which can be used as a seed for a <see cref="System.Random"/> or <see cref="SingleRandom"/>. Seed sources feature a convenient way to add multiple seeds using <see cref="Add(int)"/>, which will be sufficiently scrambled to be deterministically pseudorandom and combined into a single <see cref="int"/>. /// A seed source contains an <see cref="int"/> value which can be used as a seed for a <see cref="System.Random"/> or <see cref="SingleRandom"/>. Seed sources feature a convenient way to add multiple seeds using <see cref="Add(int)"/>, which will be sufficiently scrambled to be deterministically pseudorandom and combined into a single <see cref="int"/>.
/// This struct behaves similarly to <c>System.HashCode</c> in many ways, with an important distinction being that <see cref="SeedSource"/>'s scrambling procedure is not considered an implementation detail, and will stay consistent between process executions. /// This struct behaves similarly to <c>System.HashCode</c> in many ways, with an important distinction being that <see cref="SeedSource"/>'s scrambling procedure is not considered an implementation detail, and will stay consistent between process executions.

View file

@ -1,8 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using MLEM.Extensions;
namespace MLEM.Misc { namespace MLEM.Maths {
/// <summary> /// <summary>
/// The SingleRandom class allows generating single, one-off pseudorandom numbers based on a seed or a <see cref="SeedSource"/>. /// The SingleRandom class allows generating single, one-off pseudorandom numbers based on a seed or a <see cref="SeedSource"/>.
/// The types of numbers that can be generated are <see cref="int"/> and <see cref="float"/>, both of which can be generated with specific minimum and maximum values if desired. /// The types of numbers that can be generated are <see cref="int"/> and <see cref="float"/>, 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)); return RandomExtensions.GetRandomWeightedEntry(entries, weightFunc, SingleRandom.Single(source));
} }
/// <inheritdoc cref="GetRandomWeightedEntry{T}(System.Collections.Generic.ICollection{T},System.Func{T,int},MLEM.Misc.SeedSource)"/> /// <inheritdoc cref="GetRandomWeightedEntry{T}(System.Collections.Generic.ICollection{T},System.Func{T,int},MLEM.Maths.SeedSource)"/>
public static T GetRandomWeightedEntry<T>(ICollection<T> entries, Func<T, float> weightFunc, SeedSource source) { public static T GetRandomWeightedEntry<T>(ICollection<T> entries, Func<T, float> weightFunc, SeedSource source) {
return RandomExtensions.GetRandomWeightedEntry(entries, weightFunc, SingleRandom.Single(source)); return RandomExtensions.GetRandomWeightedEntry(entries, weightFunc, SingleRandom.Single(source));
} }

View file

@ -1,7 +1,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
namespace MLEM.Extensions { namespace MLEM.Misc {
/// <summary> /// <summary>
/// A set of extensions for dealing with collections of various kinds /// A set of extensions for dealing with collections of various kinds
/// </summary> /// </summary>

View file

@ -1,4 +1,3 @@
using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace MLEM.Misc { namespace MLEM.Misc {

View file

@ -1,7 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using MLEM.Misc; using MLEM.Maths;
namespace MLEM.Pathfinding { namespace MLEM.Pathfinding {
/// <summary> /// <summary>

View file

@ -1,6 +1,5 @@
using System; using System;
using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Audio;
using MLEM.Extensions;
namespace MLEM.Sound { namespace MLEM.Sound {
/// <summary> /// <summary>

View file

@ -1,6 +1,6 @@
using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Audio;
namespace MLEM.Extensions { namespace MLEM.Sound {
/// <summary> /// <summary>
/// A set of extensions for dealing with <see cref="SoundEffect"/> and <see cref="SoundEffectInstance"/> /// A set of extensions for dealing with <see cref="SoundEffect"/> and <see cref="SoundEffectInstance"/>
/// </summary> /// </summary>

View file

@ -1,7 +1,8 @@
using System; using System;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using MLEM.Extensions; using MLEM.Graphics;
using MLEM.Maths;
using MLEM.Misc; using MLEM.Misc;
namespace MLEM.Textures { namespace MLEM.Textures {
@ -173,17 +174,17 @@ namespace MLEM.Textures {
} }
} }
/// <inheritdoc cref="Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch,MLEM.Textures.NinePatch,MLEM.Misc.RectangleF,Microsoft.Xna.Framework.Color,float,Microsoft.Xna.Framework.Vector2,Microsoft.Xna.Framework.Graphics.SpriteEffects,float,float)"/> /// <inheritdoc cref="Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch,MLEM.Textures.NinePatch,RectangleF,Microsoft.Xna.Framework.Color,float,Microsoft.Xna.Framework.Vector2,Microsoft.Xna.Framework.Graphics.SpriteEffects,float,float)"/>
public static void Draw(this SpriteBatch batch, NinePatch texture, Rectangle destinationRectangle, Color color, float rotation, Vector2 origin, SpriteEffects effects, float layerDepth, float patchScale = 1) { 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); batch.Draw(texture, (RectangleF) destinationRectangle, color, rotation, origin, effects, layerDepth, patchScale);
} }
/// <inheritdoc cref="Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch,MLEM.Textures.NinePatch,MLEM.Misc.RectangleF,Microsoft.Xna.Framework.Color,float,Microsoft.Xna.Framework.Vector2,Microsoft.Xna.Framework.Graphics.SpriteEffects,float,float)"/> /// <inheritdoc cref="Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch,MLEM.Textures.NinePatch,RectangleF,Microsoft.Xna.Framework.Color,float,Microsoft.Xna.Framework.Vector2,Microsoft.Xna.Framework.Graphics.SpriteEffects,float,float)"/>
public static void Draw(this SpriteBatch batch, NinePatch texture, RectangleF destinationRectangle, Color color, float patchScale = 1) { 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); batch.Draw(texture, destinationRectangle, color, 0, Vector2.Zero, SpriteEffects.None, 0, patchScale);
} }
/// <inheritdoc cref="Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch,MLEM.Textures.NinePatch,MLEM.Misc.RectangleF,Microsoft.Xna.Framework.Color,float,Microsoft.Xna.Framework.Vector2,Microsoft.Xna.Framework.Graphics.SpriteEffects,float,float)"/> /// <inheritdoc cref="Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch,MLEM.Textures.NinePatch,RectangleF,Microsoft.Xna.Framework.Color,float,Microsoft.Xna.Framework.Vector2,Microsoft.Xna.Framework.Graphics.SpriteEffects,float,float)"/>
public static void Draw(this SpriteBatch batch, NinePatch texture, Rectangle destinationRectangle, Color color, float patchScale = 1) { 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); batch.Draw(texture, destinationRectangle, color, 0, Vector2.Zero, SpriteEffects.None, 0, patchScale);
} }

View file

@ -2,7 +2,7 @@ using System;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
namespace MLEM.Extensions { namespace MLEM.Textures {
/// <summary> /// <summary>
/// A set of extensions for dealing with <see cref="Texture2D"/> /// A set of extensions for dealing with <see cref="Texture2D"/>
/// </summary> /// </summary>

View file

@ -1,7 +1,7 @@
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using MLEM.Extensions;
using MLEM.Graphics; using MLEM.Graphics;
using MLEM.Maths;
using MLEM.Misc; using MLEM.Misc;
namespace MLEM.Textures { namespace MLEM.Textures {

View file

@ -1,5 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.IO; using System.IO;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using FontStashSharp; using FontStashSharp;
@ -10,13 +9,11 @@ using MLEM.Cameras;
using MLEM.Data; using MLEM.Data;
using MLEM.Data.Content; using MLEM.Data.Content;
using MLEM.Extended.Font; using MLEM.Extended.Font;
using MLEM.Extensions;
using MLEM.Font; using MLEM.Font;
using MLEM.Formatting; using MLEM.Formatting;
using MLEM.Formatting.Codes; using MLEM.Formatting.Codes;
using MLEM.Graphics; using MLEM.Graphics;
using MLEM.Input; using MLEM.Maths;
using MLEM.Misc;
using MLEM.Startup; using MLEM.Startup;
using MLEM.Textures; using MLEM.Textures;
using MLEM.Ui; using MLEM.Ui;

View file

@ -1,4 +1,4 @@
using MLEM.Extensions; using MLEM.Misc;
using NUnit.Framework; using NUnit.Framework;
namespace Tests; namespace Tests;

View file

@ -2,7 +2,7 @@ using System;
using System.IO; using System.IO;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using MLEM.Data.Json; using MLEM.Data.Json;
using MLEM.Misc; using MLEM.Maths;
using Newtonsoft.Json; using Newtonsoft.Json;
using NUnit.Framework; using NUnit.Framework;
using Vector2 = Microsoft.Xna.Framework.Vector2; using Vector2 = Microsoft.Xna.Framework.Vector2;

View file

@ -1,5 +1,5 @@
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using MLEM.Misc; using MLEM.Maths;
using NUnit.Framework; using NUnit.Framework;
namespace Tests; namespace Tests;

View file

@ -1,13 +1,9 @@
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using MLEM.Extensions; using MLEM.Extended.Maths;
using NUnit.Framework; using NUnit.Framework;
using RectangleF = MLEM.Misc.RectangleF; using RectangleF = MLEM.Maths.RectangleF;
using MLEM.Maths;
#if !FNA
using MonoGame.Extended; using MonoGame.Extended;
using MLEM.Extended.Extensions;
#endif
namespace Tests; namespace Tests;
public class NumberTests { public class NumberTests {
@ -73,7 +69,6 @@ public class NumberTests {
Assert.AreEqual(penetration, 0); Assert.AreEqual(penetration, 0);
} }
#if !FNA
[Test] [Test]
public void TestRangePercentage() { public void TestRangePercentage() {
Assert.AreEqual(0.5F, new Range<int>(1, 7).GetPercentage(4)); Assert.AreEqual(0.5F, new Range<int>(1, 7).GetPercentage(4));
@ -95,6 +90,5 @@ public class NumberTests {
Assert.AreEqual(11, new Range<float>(8, 10).FromPercentage(1.5F)); Assert.AreEqual(11, new Range<float>(8, 10).FromPercentage(1.5F));
Assert.AreEqual(7, new Range<float>(8, 10).FromPercentage(-0.5F)); Assert.AreEqual(7, new Range<float>(8, 10).FromPercentage(-0.5F));
} }
#endif
} }

View file

@ -2,7 +2,7 @@
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using MLEM.Misc; using MLEM.Maths;
using NUnit.Framework; using NUnit.Framework;
namespace Tests; namespace Tests;

View file

@ -18,6 +18,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\ThirdParty\MonoGame.Extended\source\MonoGame.Extended\FNA.Extended.csproj" />
<ProjectReference Include="..\ThirdParty\FNA\FNA.Core.csproj" /> <ProjectReference Include="..\ThirdParty\FNA\FNA.Core.csproj" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />

View file

@ -1,6 +1,5 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;
using MLEM.Data; using MLEM.Data;
using MLEM.Textures; using MLEM.Textures;

View file

@ -2,7 +2,7 @@
using System.Diagnostics; using System.Diagnostics;
using System.Linq; using System.Linq;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using MLEM.Misc; using MLEM.Maths;
using MLEM.Ui; using MLEM.Ui;
using MLEM.Ui.Elements; using MLEM.Ui.Elements;
using MLEM.Ui.Style; using MLEM.Ui.Style;