using System;
namespace XGame.Framework
{
///
/// 框架使用的事件系统 (业务不要用, 可自行使用EventSingle)
///
public sealed class FrameworkEvent : TSingleton
{
private EventModule _eventModule = new EventModule();
public void Notify(int eventId)
{
_eventModule.Notify(eventId);
}
public void Notify(int eventId, object args)
{
_eventModule.Notify(eventId, args);
}
public void AddListener(int eventId, EventDelegate handler)
{
_eventModule.AddListener(eventId, handler);
}
public void RemoveListener(int eventId, EventDelegate handler)
{
_eventModule.RemoveListener(eventId, handler);
}
protected override void OnDispose()
{
(_eventModule as IDisposable)?.Dispose();
}
}
}