Ejemplo n.º 1
0
        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());
                }
            }
        }
Ejemplo n.º 2
0
        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());
                }
            }
        }
Ejemplo n.º 3
0
 public EventAttribute(EventIdType type) : base(type)
 {
 }
Ejemplo n.º 4
0
        protected AEventAttribute(EventIdType type)
        {
			this.Type = type;
		}
Ejemplo n.º 5
0
 protected AEventAttribute(EventIdType type)
 {
     this.Type = type;
 }