Пример #1
0
        private bool VerbIsInList(PhrasalVerb possiblePhrasalVerb, List <string> verbMeaningOptions)
        {
            if (verbMeaningOptions.Any(verb => verb == possiblePhrasalVerb.VerbMeaning))
            {
                return(true);
            }

            return(false);
        }
Пример #2
0
        public void DisplayLevel()
        {
            askedPhrasalVerb   = game.GetPhrasalVerb();
            verbMeaningOptions = game.GetVerbMeaningOptions();

            askedPhrasalVerbLabel.Text = askedPhrasalVerb.VerbName;

            for (int i = 0; i < verbMeaningOptionsButtons.Count; i++)
            {
                verbMeaningOptionsButtons[i].Text = verbMeaningOptions[i];
            }

            punctuationLabel.Text = game.GetPunctuation();
        }
Пример #3
0
        private void PopulatePhrasalVerbList()
        {
            using (var reader = new StreamReader(@"Verbs/PhrasalVerbs.txt"))
            {
                while (!reader.EndOfStream)
                {
                    PhrasalVerb phrasalVerb = new PhrasalVerb();
                    var         line        = reader.ReadLine();
                    var         values      = line.Split(';');

                    phrasalVerb.VerbName    = values[0];
                    phrasalVerb.VerbMeaning = values[1];

                    PhrasalVerbs.Add(phrasalVerb);
                }
            }
        }
Пример #4
0
        internal List <string> GetVerbMeaningOptions()
        {
            List <string> verbMeaningOptions = new List <string>();

            verbMeaningOptions.Add(PhrasalVerbs[Level].VerbMeaning);

            for (int i = 0; i < NUMBER_OF_OPTIONS - 1; i++)
            {
                PhrasalVerb possiblePhrasalVerb = new PhrasalVerb();

                do
                {
                    possiblePhrasalVerb = PhrasalVerbs[random.Next(0, PhrasalVerbs.Count)];
                } while (VerbIsInList(possiblePhrasalVerb, verbMeaningOptions));

                verbMeaningOptions.Add(possiblePhrasalVerb.VerbMeaning);
            }

            verbMeaningOptions.Shuffle();

            return(verbMeaningOptions);
        }