async Task UpdateUserAchievements(User user)
    {
        AchievementsController achievementsController = AchievementsController.GetInstance();

        if (achievementsController == null)
        {
            return;
        }

        List <Achievement> achievements = await DBUserAchievements.GetUserAchievements(user.id);

        achievements.ForEach(a =>
        {
            AchievementObject achievement = achievementsController.achievements.Find(achievement => a.id == achievement.id);
            if (achievement.title != a.title)
            {
                achievement.title = a.title;
            }
            if (achievement.description != a.description)
            {
                achievement.title = a.title;
            }
            if (achievement.received != a.received)
            {
                achievement.received = a.received;
            }
            if (achievement.receiveDate != a.receiveDate)
            {
                achievement.receiveDate = a.receiveDate;
            }
        });
    }
Example #2
0
    public void Receive()
    {
        AchievementsController achievementsController = AchievementsController.GetInstance();

        if (achievement == null || achievementsController == null)
        {
            return;
        }

        achievementsController.Receive(achievement);
    }