feat: added preserver class & method to preserve assembly loading

This commit is contained in:
Syntriax 2025-05-03 20:22:35 +03:00
parent f43ab36742
commit 3725a3b0fd
5 changed files with 46 additions and 0 deletions

10
Engine.Core/Preserver.cs Normal file
View File

@ -0,0 +1,10 @@
namespace Syntriax.Engine.Core
{
// This is pretty much so the assembly gets loaded automatically because
// the builds include the assembly but sometimes doesn't link load it at startup.
// I will hopefully one day fix it and remove this.
public static class Preserver
{
public static void Preserve() { }
}
}

View File

@ -0,0 +1,10 @@
namespace Syntriax.Engine.Physics2D
{
// This is pretty much so the assembly gets loaded automatically because
// the builds include the assembly but sometimes doesn't link load it at startup.
// I will hopefully one day fix it and remove this.
public static class Preserver
{
public static void Preserve() { }
}
}

View File

@ -0,0 +1,10 @@
namespace Syntriax.Engine.Systems
{
// This is pretty much so the assembly gets loaded automatically because
// the builds include the assembly but sometimes doesn't link load it at startup.
// I will hopefully one day fix it and remove this.
public static class Preserver
{
public static void Preserve() { }
}
}

View File

@ -4,6 +4,7 @@
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>Syntriax.Engine</RootNamespace>
</PropertyGroup>
<ItemGroup>

15
Engine/Preserver.cs Normal file
View File

@ -0,0 +1,15 @@
namespace Syntriax.Engine
{
// This is pretty much so the assembly gets loaded automatically because
// the builds include the assembly but sometimes doesn't link load it at startup.
// I will hopefully one day fix it and remove this.
public static class Preserver
{
public static void Preserve()
{
Core.Preserver.Preserve();
Physics2D.Preserver.Preserve();
Systems.Preserver.Preserve();
}
}
}