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; }
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))); }
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); }