mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-22 12:58:33 +01:00
code cleanup
This commit is contained in:
parent
8745a3237e
commit
791c66b098
15 changed files with 799 additions and 801 deletions
|
@ -13,9 +13,6 @@ namespace MLEM.Data {
|
||||||
/// A dynamic enum uses <see cref="BigInteger"/> as its underlying type, allowing for an arbitrary number of enum values to be created, even when a <see cref="FlagsAttribute"/>-like structure is used that would only allow for up to 64 values in a regular enum.
|
/// A dynamic enum uses <see cref="BigInteger"/> as its underlying type, allowing for an arbitrary number of enum values to be created, even when a <see cref="FlagsAttribute"/>-like structure is used that would only allow for up to 64 values in a regular enum.
|
||||||
/// All enum operations including <see cref="And{T}"/>, <see cref="Or{T}"/>, <see cref="Xor{T}"/> and <see cref="Neg{T}"/> are supported and can be implemented in derived classes using operator overloads.
|
/// All enum operations including <see cref="And{T}"/>, <see cref="Or{T}"/>, <see cref="Xor{T}"/> and <see cref="Neg{T}"/> are supported and can be implemented in derived classes using operator overloads.
|
||||||
/// To create a custom dynamic enum, simply create a class that extends <see cref="DynamicEnum"/>. New values can then be added using <see cref="Add{T}"/>, <see cref="AddValue{T}"/> or <see cref="AddFlag{T}"/>.
|
/// To create a custom dynamic enum, simply create a class that extends <see cref="DynamicEnum"/>. New values can then be added using <see cref="Add{T}"/>, <see cref="AddValue{T}"/> or <see cref="AddFlag{T}"/>.
|
||||||
///
|
|
||||||
/// This class, and its entire concept, are extremely terrible. If you intend on using this, there's probably at least one better solution available.
|
|
||||||
/// Though if, for some weird reason, you need a way to have more than 64 distinct flags, this is a pretty good solution.
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// To include enum-like operator overloads in a dynamic enum named MyEnum, the following code can be used:
|
/// To include enum-like operator overloads in a dynamic enum named MyEnum, the following code can be used:
|
||||||
|
|
|
@ -11,6 +11,7 @@ using MLEM.Ui.Style;
|
||||||
|
|
||||||
#if NETSTANDARD2_0_OR_GREATER || NET6_0_OR_GREATER
|
#if NETSTANDARD2_0_OR_GREATER || NET6_0_OR_GREATER
|
||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
using System.Net;
|
using System.Net;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -2,7 +2,8 @@
|
||||||
using MLEM.Cameras;
|
using MLEM.Cameras;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
|
||||||
namespace Tests {
|
namespace Tests;
|
||||||
|
|
||||||
public class CameraTests {
|
public class CameraTests {
|
||||||
|
|
||||||
private TestGame game;
|
private TestGame game;
|
||||||
|
@ -27,4 +28,3 @@ namespace Tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
using MLEM.Extensions;
|
using MLEM.Extensions;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
|
||||||
namespace Tests {
|
namespace Tests;
|
||||||
|
|
||||||
public class CollectionTests {
|
public class CollectionTests {
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -28,4 +29,3 @@ namespace Tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -9,7 +9,8 @@ using Newtonsoft.Json;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using Vector2 = Microsoft.Xna.Framework.Vector2;
|
using Vector2 = Microsoft.Xna.Framework.Vector2;
|
||||||
|
|
||||||
namespace Tests {
|
namespace Tests;
|
||||||
|
|
||||||
public class DataTests {
|
public class DataTests {
|
||||||
|
|
||||||
private readonly TestObject testObject = new() {
|
private readonly TestObject testObject = new() {
|
||||||
|
@ -83,4 +84,3 @@ namespace Tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -5,7 +5,8 @@ using MLEM.Data;
|
||||||
using MLEM.Textures;
|
using MLEM.Textures;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
|
||||||
namespace Tests {
|
namespace Tests;
|
||||||
|
|
||||||
public class TestDataTextureAtlas {
|
public class TestDataTextureAtlas {
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -57,4 +58,3 @@ namespace Tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -2,7 +2,8 @@ using Microsoft.Xna.Framework;
|
||||||
using MLEM.Misc;
|
using MLEM.Misc;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
|
||||||
namespace Tests {
|
namespace Tests;
|
||||||
|
|
||||||
public class DirectionTests {
|
public class DirectionTests {
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -61,4 +62,3 @@ namespace Tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -8,7 +8,8 @@ using MLEM.Formatting.Codes;
|
||||||
using MLEM.Textures;
|
using MLEM.Textures;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
|
||||||
namespace Tests {
|
namespace Tests;
|
||||||
|
|
||||||
public class FontTests {
|
public class FontTests {
|
||||||
|
|
||||||
private TestGame game;
|
private TestGame game;
|
||||||
|
@ -154,4 +155,3 @@ namespace Tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -2,7 +2,8 @@
|
||||||
using MLEM.Input;
|
using MLEM.Input;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
|
||||||
namespace Tests {
|
namespace Tests;
|
||||||
|
|
||||||
public class KeybindTests {
|
public class KeybindTests {
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -36,4 +37,3 @@ namespace Tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -3,7 +3,8 @@ using MLEM.Extensions;
|
||||||
using MLEM.Misc;
|
using MLEM.Misc;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
|
||||||
namespace Tests {
|
namespace Tests;
|
||||||
|
|
||||||
public class NumberTests {
|
public class NumberTests {
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -68,4 +69,3 @@ namespace Tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -4,7 +4,8 @@ using Microsoft.Xna.Framework;
|
||||||
using MLEM.Pathfinding;
|
using MLEM.Pathfinding;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
|
||||||
namespace Tests {
|
namespace Tests;
|
||||||
|
|
||||||
public class PathfindingTests {
|
public class PathfindingTests {
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -124,4 +125,3 @@ namespace Tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -3,7 +3,8 @@ using MLEM.Data.Content;
|
||||||
using MLEM.Font;
|
using MLEM.Font;
|
||||||
using MLEM.Startup;
|
using MLEM.Startup;
|
||||||
|
|
||||||
namespace Tests {
|
namespace Tests;
|
||||||
|
|
||||||
public class TestGame : MlemGame {
|
public class TestGame : MlemGame {
|
||||||
|
|
||||||
public RawContentManager RawContent { get; private set; }
|
public RawContentManager RawContent { get; private set; }
|
||||||
|
@ -23,4 +24,3 @@ namespace Tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -4,7 +4,8 @@ using MLEM.Data;
|
||||||
using MLEM.Textures;
|
using MLEM.Textures;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
|
||||||
namespace Tests {
|
namespace Tests;
|
||||||
|
|
||||||
public class TexturePackerTests {
|
public class TexturePackerTests {
|
||||||
|
|
||||||
private Texture2D testTexture;
|
private Texture2D testTexture;
|
||||||
|
@ -106,4 +107,3 @@ namespace Tests {
|
||||||
private static void StubResult(TextureRegion region) {}
|
private static void StubResult(TextureRegion region) {}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -8,7 +8,8 @@ using MLEM.Ui.Elements;
|
||||||
using MLEM.Ui.Style;
|
using MLEM.Ui.Style;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
|
||||||
namespace Tests {
|
namespace Tests;
|
||||||
|
|
||||||
public class UiTests {
|
public class UiTests {
|
||||||
|
|
||||||
private TestGame game;
|
private TestGame game;
|
||||||
|
@ -147,4 +148,3 @@ namespace Tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue