Exemplo n.º 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);
        }
Exemplo n.º 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));
 }
Exemplo n.º 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));
 }
Exemplo n.º 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));
 }
Exemplo n.º 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));
 }
Exemplo n.º 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));
 }
Exemplo n.º 7
0
 public void RemoveAll(Event.Lifespan lifespan)
 {
     lock (_eventGatherQueue){
         _eventGatherQueue.Remove(i => i.EventLifespan == lifespan);
     }
 }