Ejemplo n.º 1
0
 public AccentWordInfo(AccentWordInfo otherInfo)
 {
     id             = otherInfo.id;
     section        = otherInfo.section;
     word           = otherInfo.word;
     accentPosition = otherInfo.accentPosition;
 }
Ejemplo n.º 2
0
 public void showNextWord()
 {
     if (_accentWords.Count > 0)
     {
         _currentWord = _accentWords.Dequeue();
         bool haveWordInVocabulary = _vocabulary.Contains(_currentWord);
         _window.showWord(_currentWord, haveWordInVocabulary);
     }
 }
Ejemplo n.º 3
0
 private void reset(bool fullReset = false)
 {
     _window              = null;
     _currentWord         = null;
     _completedWordsCount = 0;
     _skippedWordsCount   = 0;
     if (fullReset)
     {
         _currentSection = 0;
         _accentWords.Clear();
         _mistakes.Clear();
     }
 }
Ejemplo n.º 4
0
 public void showExerciseResults()
 {
     _currentWord = null;
     new ui.ExerciseResultWindow(getLocalizedNameForSection(_currentSection), _completedWordsCount, _mistakes.Count, _skippedWordsCount,
                                 () =>
     {
         finishExercise();
     },
                                 () =>
     {
         startMistakesCorrection();
     }).Show();
 }
Ejemplo n.º 5
0
        public List <AccentWordInfo> prepareMaterial()
        {
            List <AccentWordInfo> ret = new List <AccentWordInfo>();

            JObject config     = SharedLocator.getStaticInfo().getAccentsExerciseConfig();
            JArray  wordsArray = (JArray)config[KEY_CONTENTS];

            ret.Capacity = wordsArray.Count;
            foreach (JObject obj in wordsArray)
            {
                AccentWordInfo wordInfo = new AccentWordInfo(obj);
                ret.Add(wordInfo);
                if (!_sectionsList.ContainsKey(wordInfo.section))
                {
                    _sectionsList.Add(wordInfo.section, Properties.Strings.ResourceManager.GetString(string.Format(ACCENTS_SECTION_NAME_TEMPLATE, wordInfo.section)));
                }
            }
            _sectionsList.Add(Constants.EXERCISE_SECTION_EVERYTHING, Properties.Strings.section_name_shuffle);

            return(ret);
        }
Ejemplo n.º 6
0
 public bool isWordInVocabulary(AccentWordInfo info)
 {
     return(_vocabulary.Contains(info));
 }
Ejemplo n.º 7
0
 public void addWordToVocabulary(AccentWordInfo info)
 {
     _vocabulary.Add(info);
 }