コード例 #1
0
        private static void ScanReverseLetters(Letter currentLetter, List<WordBuilder> builderList, WordBuilder previousBuilder)
        {
            WordBuilder newBuilder = new WordBuilder(previousBuilder);
            newBuilder.Prepend(currentLetter);
            builderList.Add(new WordBuilder(newBuilder));
            if ((newBuilder.CurrentString.Length > Shorewood.normalGameplayRenderer.grid.minimumWordLength))
            {
                if (!CheckValidWord(newBuilder))
                {
                    return;
                }
            }

            if (Shorewood.normalGameplayRenderer.grid.GetLetter(currentLetter.upperLeftNeighbor) != Letter.EmptyLetter)
            {
                ScanReverseLetters(Shorewood.normalGameplayRenderer.grid.GetLetter(currentLetter.upperLeftNeighbor), builderList, newBuilder);
            }
            if (Shorewood.normalGameplayRenderer.grid.GetLetter(currentLetter.leftNeighbor) != Letter.EmptyLetter)
            {
                ScanReverseLetters(Shorewood.normalGameplayRenderer.grid.GetLetter(currentLetter.leftNeighbor), builderList, newBuilder);
            }
            if (Shorewood.normalGameplayRenderer.grid.GetLetter(currentLetter.lowerLeftNeighbor) != Letter.EmptyLetter)
            {
                ScanReverseLetters(Shorewood.normalGameplayRenderer.grid.GetLetter(currentLetter.lowerLeftNeighbor), builderList, newBuilder);
            }
        }