public NotificationQueue(Notification notification, NotificationParam param)
 {
     this.Notification = notification;
     this.param        = param;
 }
예제 #2
0
        private void NotifyAllControllers(ControllerType notifyingController, bool canListenToOwnNotification, Notification notification, NotificationParam param)
        {
            if (controllers == null)
            {
                return;
            }

            for (int i = 0; i < controllers.Count; i++)
            {
                if (controllers[i].type == notifyingController && !canListenToOwnNotification)
                {
                    continue;
                }
                controllers[i].OnNotificationReceived(notification, param);
            }
        }
예제 #3
0
 public NotificationQueue(ControllerType notifyingController, bool canListenToOwnNotification, Notification notification, NotificationParam param)
 {
     this.notifyingController        = notifyingController;
     this.canListenToOwnNotification = canListenToOwnNotification;
     this.Notification = notification;
     this.param        = param;
 }
예제 #4
0
        public void Notify(ControllerType notifyingController, bool canListenToOwnNotification, Notification notification, NotificationParam param = null)
        {
            switch (status)
            {
            case NotificationStatus.Locked:
                if (param != null)
                {
                    if (param.shouldQueue)
                    {
                        NotificationQueue nq = new NotificationQueue(notifyingController, canListenToOwnNotification, notification, param);
                        notificationQueue.Enqueue(nq);
                    }
                }
                break;

            case NotificationStatus.Unlocked:
                NotifyAllControllers(notifyingController, canListenToOwnNotification, notification, param);
                break;
            }
        }