Пример #1
0
        public int Enqueue <T>(
            EventType eventType,
            Event.Lifespan lifespan,
            double delay,
            int senderId,
            int receiverId,
            EventDelegate <T> eventDelegate,
            T eventData,
            object eventKey)
        {
            var eventToSchedule =
                Event <T> .Obtain(
                    ++_nextEventId,
                    eventType,
                    lifespan,
                    Time.time + delay, // dispatch time
                    senderId,
                    receiverId,
                    eventDelegate,
                    eventData);

            lock (_eventGatherQueue){
                _eventGatherQueue.Enqueue(eventToSchedule, eventToSchedule.DispatchTime);
            }

            return(eventToSchedule.EventId);
        }
Пример #2
0
 public int Enqueue <T>(
     EventType eventType,
     Event.Lifespan lifespan,
     int receiverId,
     T eventData)
 {
     return(Enqueue(eventType, lifespan, _NO_DELAY, _SENDER_ID_IRRELEVANT, receiverId, null, eventData, null));
 }
Пример #3
0
 public int Enqueue <T>(
     EventType eventType,
     Event.Lifespan lifespan,
     int senderId,
     int receiverId,
     T eventData)
 {
     return(Enqueue(eventType, lifespan, _NO_DELAY, senderId, receiverId, null, eventData, null));
 }
Пример #4
0
 public int Enqueue <T>(
     EventType eventType,
     Event.Lifespan lifespan,
     EventDelegate <T> eventDelegate,
     T eventData)
 {
     return(Enqueue(eventType, lifespan, _NO_DELAY, _SENDER_ID_IRRELEVANT, RECEIVER_ID_IRRELEVANT, eventDelegate,
                    eventData, null));
 }
Пример #5
0
 public int Enqueue <T>(
     EventType eventType,
     Event.Lifespan lifespan,
     double delay,
     T eventData)
 {
     return(Enqueue(eventType, lifespan, delay, _SENDER_ID_IRRELEVANT, RECEIVER_ID_IRRELEVANT, null, eventData,
                    null));
 }
Пример #6
0
 public int Enqueue <T>(
     EventType eventType,
     Event.Lifespan lifespan,
     int senderId,
     int receiverId,
     EventDelegate <T> eventDelegate,
     T eventData,
     object eventKey)
 {
     return(Enqueue(eventType, lifespan, _NO_DELAY, senderId, receiverId, eventDelegate, eventData, eventKey));
 }
Пример #7
0
 public void RemoveAll(Event.Lifespan lifespan)
 {
     lock (_eventGatherQueue){
         _eventGatherQueue.Remove(i => i.EventLifespan == lifespan);
     }
 }