Example #1
0
        //Constructer gets words from file when game is inittialized
        public Game()
        {
            AllWords = new List <GuessingWord>();
            using StreamReader file = new StreamReader(@"AllWords.txt");
            int    count = 0;
            string line;

            while ((line = file.ReadLine()) != null)
            {
                count++;
                string[]     str = line.Split(" ");
                GuessingWord aux = new GuessingWord(str[0], str[1]);
                AllWords.Add(aux);
            }

            file.Close();
        }
Example #2
0
        public CurrentMatch(GuessingWord currentWord)
        {
            Attempts   = 5;
            IsMatchWon = false;

            AllLetters   = new List <Letters>();
            WrongLetters = new List <char>();

            this.CurrentWord = currentWord;

            for (int i = 0; i < currentWord.NumberOfLetters(); i++)
            {
                Letters aux = new Letters();
                aux.letter = currentWord.Word[i];

                AllLetters.Add(aux);
            }
        }