public NotificationQueue(Notification notification, NotificationParam param) { this.Notification = notification; this.param = param; }
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); } }
public NotificationQueue(ControllerType notifyingController, bool canListenToOwnNotification, Notification notification, NotificationParam param) { this.notifyingController = notifyingController; this.canListenToOwnNotification = canListenToOwnNotification; this.Notification = notification; this.param = param; }
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; } }