Exemple #1
0
        public void CanGetNotifications()
        {
            // Assign
            var key = "Skill_CanGetNotifications";

            Helpers.Login(Fixture.SUGARClient, key, key, out var game, out var loggedInAccount);

            Fixture.SUGARClient.Skill.EnableNotifications(true);

            CompleteGenericEvaluation(key, loggedInAccount.User.Id, game.Id);

            // Act
            var didGetnotification = false;
            EvaluationNotification gotNotification = null;
            var didGetSpecificConfiguration        = false;

            while (Fixture.SUGARClient.Skill.TryGetPendingNotification(out var notification))
            {
                didGetnotification           = true;
                gotNotification              = notification;
                didGetSpecificConfiguration |= notification.Name == key;
            }

            // Assert
            Assert.True(didGetnotification);
            Assert.NotNull(gotNotification);

            Assert.True(didGetSpecificConfiguration);
        }
 /// <summary>
 /// If the animation is not playing, start the animation coroutine.
 /// </summary>
 protected override void Display(EvaluationNotification notification)
 {
     if (!_animation.isPlaying)
     {
         StartCoroutine(AnimatePopup());
     }
 }
 /// <summary>
 /// Gets pending skill progress notifications.
 /// </summary>
 /// <param name="notification"></param>
 /// <returns>Returns a boolean value indicating whether there was a notification to retrieve or not.</returns>
 public bool TryGetPendingNotification(out EvaluationNotification notification)
 {
     return(EvaluationNotifications.TryDequeue(EvaluationType.Skill, out notification));
 }
Exemple #4
0
 /// <summary>
 /// Functionality to be triggered when a notification is received.
 /// </summary>
 /// <param name="notification">Notification which will be displayed.</param>
 protected abstract void Display(EvaluationNotification notification);
Exemple #5
0
 internal void Notification(EvaluationNotification notification)
 {
     _evaluationQueue.Add(notification);
     transform.SetAsLastSibling();
     Display(notification);
 }
 private void HandleNotification(EvaluationNotification notification)
 {
     _landscapeAchievementPopup?.Notification(notification);
     _portraitAchievementPopup?.Notification(notification);
 }