diff --git a/GFramework.Core/architecture/ArchitectureRuntime.cs b/GFramework.Core/architecture/ArchitectureRuntime.cs index dfe5af2..6ee87bc 100644 --- a/GFramework.Core/architecture/ArchitectureRuntime.cs +++ b/GFramework.Core/architecture/ArchitectureRuntime.cs @@ -67,7 +67,7 @@ public class ArchitectureRuntime(IArchitectureContext context) : IArchitectureRu /// /// 事件类型 /// 要发布的事件实例 - public void SendEvent(TEvent e) + public void SendEvent(TEvent e) where TEvent : class { _context.SendEvent(e); } diff --git a/GFramework.Core/architecture/IArchitectureRuntime.cs b/GFramework.Core/architecture/IArchitectureRuntime.cs index 5433195..37ccb67 100644 --- a/GFramework.Core/architecture/IArchitectureRuntime.cs +++ b/GFramework.Core/architecture/IArchitectureRuntime.cs @@ -1,9 +1,6 @@ using GFramework.Core.command; using GFramework.Core.events; -using GFramework.Core.model; using GFramework.Core.query; -using GFramework.Core.system; -using GFramework.Core.utility; namespace GFramework.Core.architecture; @@ -39,28 +36,28 @@ public interface IArchitectureRuntime /// /// 发送无参事件 /// - /// 事件类型,必须具有无参构造函数 - void SendEvent() where T : new(); + /// 事件类型,必须具有无参构造函数 + void SendEvent() where TEvent : new(); /// /// 发送指定的事件实例 /// - /// 事件类型 + /// 事件类型 /// 要发送的事件实例 - void SendEvent(T e); + void SendEvent(TEvent e) where TEvent : class; /// /// 注册事件监听器 /// - /// 事件类型 + /// 事件类型 /// 事件触发时的回调方法 /// 用于取消注册的句柄 - IUnRegister RegisterEvent(Action onEvent); + IUnRegister RegisterEvent(Action onEvent); /// /// 取消注册事件监听器 /// - /// 事件类型 + /// 事件类型 /// 要取消注册的事件回调方法 - void UnRegisterEvent(Action onEvent); + void UnRegisterEvent(Action onEvent); } \ No newline at end of file