Ejemplo n.º 1
0
        void UpdateDateOfNextQuestionAttempt(LogEntry line, PathSwitchKind switchKind)
        {
            if (line == null)
            {
                throw new ArgumentNullException("line");
            }

            int cdInHrs        = 0;
            int nextMeditLevel = 0;

            if (switchKind == PathSwitchKind.PathBegin)
            {
                nextMeditLevel = 1;
            }
            else if (switchKind == PathSwitchKind.PathReset)
            {
                nextMeditLevel = 0;
                // there is a 24h cooldown before new path can be learned
                NextQuestionAttemptOverridenUntil = line.Timestamp + TimeSpan.FromHours(24);
            }
            else
            {
                // PathAdvance
                nextMeditLevel = MeditationPaths.FindLevel(line.Content) + 1;
            }

            cdInHrs = MeditationPaths.GetCooldownHoursForLevel(nextMeditLevel, MeditationSkill)
                      .ConstrainToRange(0, int.MaxValue);

            DateOfNextQuestionAttempt = line.Timestamp + TimeSpan.FromHours(cdInHrs);
        }
Ejemplo n.º 2
0
        internal void SetManualQTimer(int meditLevel, DateTime originDate)
        {
            int hours = MeditationPaths.GetCooldownHoursForLevel(meditLevel, MeditationSkill)
                        .ConstrainToRange(0, int.MaxValue);

            NextQuestionAttemptOverridenUntil = originDate + TimeSpan.FromHours(hours);
            UpdateCooldown();
        }