Difference between revisions of "UpdateAfterAllowedWord"

From TRCCompSci - AQA Computer Science
Jump to: navigation, search
(Created page with "<syntaxhighlight lang=csharp> private static void UpdateAfterAllowedWord(string Word, ref string PlayerTiles, ref int PlayerScore, ref int PlayerTilesPlayed, Dictionary<char,...")
(No difference)

Revision as of 12:15, 14 November 2017

private static void UpdateAfterAllowedWord(string Word, ref string PlayerTiles, ref int PlayerScore, ref int PlayerTilesPlayed, Dictionary<char, int> TileDictionary, List<string> AllowedWords)
        {
            PlayerTilesPlayed = PlayerTilesPlayed + Word.Length;
            foreach (var Letter in Word)
            {
                PlayerTiles = PlayerTiles.Remove(PlayerTiles.IndexOf(Letter), 1);
            }
            PlayerScore = PlayerScore + GetScoreForWord(Word, TileDictionary);
        }