private void TryLetter(string letter) { bool letterFound = this.CurrentGame.TryLetter(letter); int currentPercent = this.CurrentGame.GetWordPercentRemaining(); if (letterFound && currentPercent == 100) { WordFoundMessage wf = new WordFoundMessage(this, this.CurrentWord); Messenger.Default.Send(wf); return; } else if (!letterFound && (this.currentGame.TotalTriesPerWordRemaining == Game.MaxTriesPerWord || this.currentGame.TotalTriesPerWordRemaining == 0)) { WordNotFoundMessage wnf = new WordNotFoundMessage(this, this.CurrentWord); Messenger.Default.Send(wnf); return; } if (letterFound) { LetterFoundMessage lf = new LetterFoundMessage(this, letter); Messenger.Default.Send(lf); } else { LetterNotFoundMessage lnf = new LetterNotFoundMessage(this, letter); Messenger.Default.Send(lnf); } }
private void TryWord(string word) { if (this.CurrentGame.TryWord(word)) { WordFoundMessage wf = new WordFoundMessage(this, word); Messenger.Default.Send(wf); } else { WordNotFoundMessage wnf = new WordNotFoundMessage(this, word); Messenger.Default.Send(wnf); } }
private void WordNotFound(WordNotFoundMessage wordNotFoundMessage) { this.Mplayer.Open(this.wordNotFoundPath); this.Mplayer.Play(); }