12345678910111213141516171819202122232425262728293031323334 |
- using System;
- namespace ET
- {
- public interface IEvent
- {
- Type Type { get; }
- }
-
- public abstract class AEvent<A>: IEvent where A: struct
- {
- public Type Type
- {
- get
- {
- return typeof (A);
- }
- }
- protected abstract ETTask Run(Scene scene, A a);
- public async ETTask Handle(Scene scene, A a)
- {
- try
- {
- await Run(scene, a);
- }
- catch (Exception e)
- {
- Log.Error(e);
- }
- }
- }
- }
|