- Finished most of LuaCsSetup top-level functionality.

- Removed some unneeded interface definitions.
- Clean-slated some Services that need to be re-written.
This commit is contained in:
MapleWheels
2025-02-14 12:34:59 -05:00
committed by Maplewheels
parent d2b9ca4c1b
commit 7436ea3e8c
39 changed files with 1009 additions and 2045 deletions
@@ -83,6 +83,7 @@ public class EventService : IEventService, IEventAssemblyContextUnloading
public EventService(Lazy<IPluginManagementService> pluginManagementService)
{
_pluginManagementService = pluginManagementService ?? throw new ArgumentNullException(nameof(pluginManagementService));
this.Subscribe<IEventAssemblyContextUnloading>(this);
}
public bool IsDisposed { get; private set; } = false;
@@ -301,8 +302,19 @@ public class EventService : IEventService, IEventAssemblyContextUnloading
dict.Remove(OneOf<string, IEvent>.FromT1(subscriber));
}
public void ClearAllEventSubscribers<T>() where T : IEvent => _subscriptions.Remove(typeof(T));
public void ClearAllSubscribers() => _subscriptions.Clear();
public void ClearAllEventSubscribers<T>() where T : IEvent
{
_subscriptions.Remove(typeof(T));
if (typeof(IEventAssemblyContextUnloading) == typeof(T))
{
this.Subscribe<IEventAssemblyContextUnloading>(this);
}
}
public void ClearAllSubscribers()
{
_subscriptions.Clear();
this.Subscribe<IEventAssemblyContextUnloading>(this);
}
public FluentResults.Result PublishEvent<T>(Action<T> action) where T : IEvent<T>
{