示例#1
0
        public bool guessWord(string playerName, string guessedWord, string unscrambledWord)
        {
            //find the player name in the active player list, if not found, throw exception.
            if (!activePlayers.Contains(playerName))
            {
                PlayerNotPlayingGameFault noGame4u = new PlayerNotPlayingGameFault();
                noGame4u.problem = "You're not playing this game.";
                throw new FaultException <PlayerNotPlayingGameFault>(noGame4u);
            }

            //compare (must EXACTLY MATCH)
            if (guessedWord.Trim() == unscrambledWord.Trim())
            {
                gameOverYeah = true;
                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#2
0
        public bool guessWord(string playerName, string guessedWord, string unscrambledWord)
        {
            //find the player name in the active player list, if not found, throw exception.
            if(!activePlayers.Contains(playerName))
            {
                PlayerNotPlayingGameFault noGame4u = new PlayerNotPlayingGameFault();
                noGame4u.problem = "You're not playing this game.";
                throw new FaultException<PlayerNotPlayingGameFault>(noGame4u);
            }

            //compare (must EXACTLY MATCH)
            if(guessedWord.Trim() == unscrambledWord.Trim())
            {
                gameOverYeah = true;
                return true;

            }
            else
            {
                return false;
            }
        }