Code/SboxSuperuser/Superuser.NativeBindings.cs

A small partial class adding a factory method that creates an admin/settings module for native bindings. It finds an authoritative runtime, errors if none, and returns a new Engine.NativeSettings.NativeBindingsModule with provided setting and command descriptors.

Native Interop
namespace SboxSuperuser;

public static partial class Superuser
{
	/// <summary>Creates the optional settings module for RegisterModulesAsync; call once per authoritative runtime from trusted game setup.</summary>
	public static IAdminModule CreateNativeBindingsModule( IEnumerable<NativeSettingDescriptor> settings,
		IEnumerable<NativeCommandBindingDescriptor> commands = null )
	{
		var runtime = FindAuthorityRuntime() ?? throw new InvalidOperationException( "An eligible authoritative runtime is required." );
		return new Engine.NativeSettings.NativeBindingsModule( runtime, settings, commands );
	}
}