コード例 #1
0
        public void MarkStudied(Word word, bool correctTranslationChosen)
        {
            if (word == null)
            {
                throw new ArgumentNullException(nameof(word));
            }

            var existingWord = _studiedWords.Find(studiedWord => word.Original == studiedWord.Word.Original);

            if (existingWord != null)
            {
                var updatedWord = new StudiedWord(
                    Id,
                    word,
                    correctTranslationChosen ? existingWord.TimesLearned + 1 : existingWord.TimesLearned);
                _studiedWords.Remove(existingWord);
                _studiedWords.Add(updatedWord);
                return;
            }

            var newWord = new StudiedWord(Id, word, correctTranslationChosen ? 1 : 0);

            _studiedWords.Add(newWord);
        }
コード例 #2
0
 private bool IsUncomplete(StudiedWord studiedWord)
 {
     return(studiedWord.TimesLearned < _settings.UserWordsToCompletion);
 }