Esempio n. 1
0
        private VocabularyContents CreateContentsFromFunc(Func <KeyValuePair <JourneyPosition, VocabularyContents>, bool> function)
        {
            var contents = new VocabularyContents();

            foreach (var pair in playSessionsContents.Where(function))
            {
                contents.UnionWith(pair.Value);
            }
            return(contents);
        }
Esempio n. 2
0
        private void AddToHashSetFilteringByContents <T>(VocabularyContents contents, List <T> inputList, HashSet <T> outputHash, ref int nRemaining)
        {
            int nBefore = outputHash.Count;

            contents.AddAndFilterHashSetByContents(inputList, outputHash);
            nRemaining -= outputHash.Count - nBefore;
            if (nRemaining < 0)
            {
                nRemaining = 0;
            }
        }
Esempio n. 3
0
        public void AddPlaySession(string psId, List <LetterData> letters, List <WordData> words, List <PhraseData> phrases)
        {
            var newContents = new VocabularyContents();

            newContents.UnionWith(letters);
            newContents.UnionWith(words);
            newContents.UnionWith(phrases);
            playSessionsContents[new JourneyPosition(psId)] = newContents;

            allContents.UnionWith(letters);
            allContents.UnionWith(words);
            allContents.UnionWith(phrases);
        }
Esempio n. 4
0
        public void LoadCurrentPlaySessionData(string currentPlaySessionId)
        {
            var pos = new JourneyPosition(currentPlaySessionId);

            currentJourneyContents       = progressionContents.GetContentsUpToPlaySession(pos);
            currentPlaySessionContents   = progressionContents.GetContentsOfPlaySession(pos);
            currentLearningBlockContents = progressionContents.GetContentsOfLearningBlock(pos);
            currentStageContents         = progressionContents.GetContentsOfStage(pos);

            if (ConfigAI.VerbosePlaySessionInitialisation)
            {
                string debugString = "";
                debugString += ConfigAI.FormatTeacherReportHeader("Play Session Initalisation (" + currentPlaySessionId + ")");
                debugString += "\n Current PS:\n" + currentPlaySessionContents;
                debugString += "\n Current LB:\n" + currentLearningBlockContents;
                debugString += "\n Current ST:\n" + currentStageContents;
                debugString += "\n Current journey:\n" + currentJourneyContents;
                debugString += "\n Whole contents:\n" + progressionContents.AllContents;
                ConfigAI.AppendToTeacherReport(debugString);
            }
        }
Esempio n. 5
0
 public void UnionWith(VocabularyContents otherContents)
 {
     UnionWith(otherContents.GetHashSet <LetterData>());
     UnionWith(otherContents.GetHashSet <WordData>());
     UnionWith(otherContents.GetHashSet <PhraseData>());
 }