public void Run <A>(EventIdType type, A a) { List <object> iEvents = null; if (!this.allEvents.TryGetValue(type, out iEvents)) { return; } foreach (object obj in iEvents) { try { var iEvent = obj as IEvent <A>; if (iEvent == null) { throw new GameException($"event type: {type} is not IEvent<{typeof (A).Name}>"); } iEvent.Run(a); } catch (Exception err) { Log.Error(err.ToString()); } } }
public void Run <A, B, C, D, E, F>(EventIdType type, A a, B b, C c, D d, E e, F f) { List <object> iEvents = null; if (!this.allEvents.TryGetValue(type, out iEvents)) { return; } foreach (object obj in iEvents) { try { var iEvent = obj as IEvent <A, B, C, D, E, F>; if (iEvent == null) { throw new GameException( $"event type: {type} is not IEvent<{typeof(A).Name}, {typeof(B).Name}, {typeof(C).Name}, {typeof(D).Name}, {typeof(E).Name}>"); } iEvent.Run(a, b, c, d, e, f); } catch (Exception err) { Log.Error(err.ToString()); } } }
public EventAttribute(EventIdType type) : base(type) { }
protected AEventAttribute(EventIdType type) { this.Type = type; }