예제 #1
0
    public void SubmitWord()
    {
        string word = levelView.GetWord();

        Level.WordValidity validity = level.GetValidity(word);

        switch (validity)
        {
        case Level.WordValidity.Found:
            levelView.DisplayMessage("You already found that word.");
            break;

        case Level.WordValidity.Correct:
            CorrectWord(word);
            break;

        case Level.WordValidity.Bonus:
            level.AddFoundWord(word);
            levelView.AddBonusWord(word);
            levelView.DisplayMessage("You found a bonus word!");
            break;

        case Level.WordValidity.Real:
            levelView.DisplayMessage("You can't use some of those characters!");
            break;

        case Level.WordValidity.Fake:
            levelView.DisplayMessage("That's not a real word.");
            break;

        default:
            throw new System.Exception(string.Format("Found unimplemented validity {0}", validity.ToString()));
        }
    }