Exemple #1
0
        private void UpdateNextRepeat(Domain.Card card, QuestionSideEnum questionSide)
        {
            var nextRepeat = nextRepeatCalculator.Calculate(card, questionSide);
            var side       = questionSide == QuestionSideEnum.Heads ? card.Heads : card.Tails;

            side.State.NextRepeat = nextRepeat;
        }
Exemple #2
0
        public DateTime Calculate(Card card, QuestionSideEnum questionSide)
        {
            var side         = questionSide == QuestionSideEnum.Heads ? card.Heads : card.Tails;
            var repeatsCount = card.Repeats.Count(r => r.QuestionSide == questionSide);

            return(timeProvider.GetDate().AddDays(GetDay(side.State.Drawer)));
        }
Exemple #3
0
        private void AddRepeat(Domain.Card card, QuestionSideEnum questionSide, RepeatResultEnum repeatReuslt, Domain.Lesson lesson)
        {
            var newResult = new Repeat
            {
                DateTime     = timeProvider.GetTime(),
                Lesson       = lesson,
                QuestionSide = questionSide,
                Result       = (int)repeatReuslt,
                Word         = card
            };

            dbContext.Repeats.Add(newResult);
        }