예제 #1
0
 public virtual void SortWords(WordSorter wordSorter)
 {
     if (wordSorter != null)
     {
         wordSorter.Sort(_words);
     }
 }
예제 #2
0
        public Solution(Board board, WordSorter wordSorter = null)
        {
            if (Dictionary == null)
            {
                SetDictionary();
            }

            _board = board;

            foreach (Tile tile in _board.Tiles)
            {
                SearchUsing(tile, new List <Tile>(), string.Empty, new TrieSearchResult());
            }

            _words      = _stringWordMap.Values.ToArray();
            TotalPoints = _words.Sum(w => w.BestPathPoints);
            SortWords(wordSorter);
        }