using System;
using System.Collections.Generic;
using AlicizaX.Runtime;
namespace AlicizaX.EventKit.Runtime
{
///
/// 事件工具类
///
public static class EventKit
{
private static EventPublisher _publisher;
public static EventPublisher Publisher => _publisher;
private static List eventMaps = new List();
internal static void Init()
{
eventMaps = new List();
_publisher = new EventPublisher();
}
internal static void Release()
{
_publisher = null;
foreach (var _event in eventMaps)
{
_event();
}
eventMaps.Clear();
}
///
/// 外部不允许调用
///
///
public static void AddResetHandler(Action action)
{
eventMaps.Add(action);
}
}
}