using System; namespace ET { public interface IEvent { Type GetEventType(); } [Event] public abstract class AEvent: IEvent where A: struct { public Type GetEventType() { return typeof (A); } public abstract ETTask Run(A args); public async ETTask Handle(A args) { try { await Run(args); } catch (Exception e) { Log.Error(e); } } } [Event] public abstract class AEvent_Sync : IEvent where A : struct { public Type GetEventType() { return typeof(A); } public abstract void Run(A args); public void Handle(A args) { try { Run(args); } catch (Exception e) { Log.Error(e); } } } }