namespace EventBus
{
    public sealed class EventArgs<T> : IEventArgs<T>
    {
        private readonly T data;
        private readonly Type type = typeof(void);
        private readonly IEventBroker eventBroker;
        private readonly IBaseEventData baseEventData;
        private readonly Guid intPtr;
        public IEventBroker EventBroker => eventBroker;
        public Guid FunctionPtr => intPtr;
        public IBaseEventData BaseEventData => baseEventData;
        /// <summary>
        /// 
        /// </summary>
        public bool Handle { get; set; }
        /// <summary>
        /// 事件数据
        /// </summary>
        public T Data => data;
        public Type ReturnType => type;

        public EventArgs(T value, IEventBroker eventBroker, Guid FuncintPtr, IBaseEventData eventData)
        {
            this.eventBroker = eventBroker;
            this.intPtr = FuncintPtr;
            data = value;
            baseEventData = eventData;
        }
        public EventArgs(T value, IEventBroker eventBroker, Guid FuncintPtr, IBaseEventData eventData, Type returntype) : this(value, eventBroker, FuncintPtr, eventData)
        {
            this.type = returntype;
        }

    }
}