Exemplo n.º 1
0
        /// <summary>
        /// If user knows the entry, it is moved from one chamber to the next.
        /// If not, it is moved at the back of the first chamber to make it re-occur again within 
        /// a reasonable time of iterating through the dictionary entries.
        /// </summary>
        /// <param name="knowsEntry"></param>
        /// <param name="w"></param>
        /// <param name="next"></param>
        private void handleAnswer(bool knowsEntry, WordChamber w, WordChamber next)
        {
            if (mCurrentWord < 0)
                throw new Exception("Current word index is not valid");

            if (knowsEntry)
            {
                mCurrentWord = w.removeFirst();
                next.putLast(mCurrentWord);

                // If next is the sixth chamber, increase counter of known words.
                if (next.ID > WordChamber.ChamberType.C5)
                    mKnownWords++;
            }
            else
            {
                mFirstChamber.putLast(w.removeFirst());
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Does the chamber we're checking have more space for additional entries?
        /// </summary>
        /// <param name="chamber"></param>
        /// <returns></returns>
        private bool chamberCheck(WordChamber chamber)
        {
            if (chamber.InChamber < WordChamber.chamber(chamber.ID))
                return (false);

            mCurrentWord = chamber.First;
            mNewWordsInUse = false;
            return (true);
        }