public override void Update(TrackResult e)
        {
            Dominating ev = e as Dominating;

            if (ev == null)
            {
                return;
            }

            ev.Habits.AddLogsHabit(1, DateTime.Now);
        }
Ejemplo n.º 2
0
        public override void Update(Trigger e)
        {
            if (badgeRepository == null)
            {
                return;
            }

            Dominating ev = e as Dominating;

            if (ev == null)
            {
                return;
            }

            Badge badge = _gainer.Gain();
            Badge b     = badgeRepository.FindByName(badge.Name);

            if (b == null)
            {
                badgeRepository.Create(badge);
                b = badgeRepository.FindByName(badge.Name);
            }
            badgeRepository.AddUser(b, ev.User_id);
        }