Files
RobustToolbox/Robust.UnitTesting/TestingModLoader.cs
Pieter-Jan Briers 7473b6dae1 Optimize assembly type checking.
It's now parallelized which cuts off ~200ms on its own for me.
Config is now shared between multiple loads which saves a lot as well.

All in all, pretty good.
2020-12-14 16:34:33 +01:00

51 lines
1.3 KiB
C#

using System;
using System.IO;
using System.Reflection;
using Robust.Shared.ContentPack;
using Robust.Shared.Utility;
namespace Robust.UnitTesting
{
internal sealed class TestingModLoader : BaseModLoader, IModLoaderInternal
{
public Assembly[] Assemblies { get; set; } = Array.Empty<Assembly>();
public bool TryLoadModulesFrom(ResourcePath mountPath, string filterPrefix)
{
foreach (var assembly in Assemblies)
{
InitMod(assembly);
}
return true;
}
public void LoadGameAssembly(Stream assembly, Stream? symbols = null, bool skipVerify = false)
{
throw new NotSupportedException();
}
public void LoadGameAssembly(string diskPath, bool skipVerify = false)
{
throw new NotSupportedException();
}
public bool TryLoadAssembly(string assemblyName)
{
throw new NotSupportedException();
}
public void SetUseLoadContext(bool useLoadContext)
{
// Nada.
}
public void SetEnableSandboxing(bool sandboxing)
{
// Nada.
}
public Func<string, Stream?>? VerifierExtraLoadHandler { get; set; }
}
}