Ejemplo n.º 1
0
 private void ReceivedNotification(ITimeNotification notification)
 {
     if (!_settings.Enabled)
     {
         return;
     }
     if ((!_settings.NotifyInGame && _gameScenesManager.currentScenesContainer.TryResolve <IDifficultyBeatmap>() != null) || IsViewing)
     {
         _queue.Enqueue(notification);
     }
     else
     {
         NotificationPing?.Invoke(notification);
     }
 }
Ejemplo n.º 2
0
 public void CheckForNotifications()
 {
     for (int i = 0; i < _notifications.Count; i++)
     {
         var notification = _notifications.ElementAt(i);
         if (notification.TimeReached())
         {
             NotificationPing?.Invoke(notification);
             if (notification.GetUnregisterAfterComplete())
             {
                 _unregistrationQueue.Enqueue(notification);
             }
         }
     }
     // Separate notification queue to not modify the notification list before it finishes iterating.
     for (int i = 0; i < _unregistrationQueue.Count; i++)
     {
         UnregisterNotification(_unregistrationQueue.Dequeue());
     }
     _unregistrationQueue.Clear();
 }