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();
        }
Ejemplo n.º 3
0
        void InitializeChoiceList()
        {
            foreach (var keyval in MeditationPaths.GetLevelToTitlesPairs())
            {
                string level  = keyval.Key.ToString();
                string titles = "";
                foreach (string str in keyval.Value)
                {
                    titles += str + ", ";
                }
                if (titles.Length > 0)
                {
                    titles = titles.Remove(titles.Length - 2, 2);
                }

                string output = "Level " + level + ": " + titles;
                listBox1.Items.Add(output);
            }
            listBox1.Refresh();
        }