Esempio n. 1
0
        private void CreateEncodeWord()
        {
            EncodedWord = Word;
            List <char> goodLetters = GoodGuesses.Select(g => g.Letter).ToList();

            foreach (char c in Word.Distinct())
            {
                if (!goodLetters.Contains(c))
                {
                    EncodedWord = EncodedWord.Replace(c, '_');
                }
            }
        }
Esempio n. 2
0
 private void AddCharGuess(CharGuess guess)
 {
     AllGuesses.Add(guess);
     if (guess.IsGoodGuess)
     {
         GoodGuesses.Add(guess);
         CreateEncodeWord();
         if (EvaluateWord(EncodedWord))
         {
             FinishGame(true);
         }
     }
     else
     {
         BadGuesses.Add(guess);
         EndGameIfLost();
     }
     UpdateReadOnlyProperties();
 }