protected BaseWordConstructor(int startLetter, WordSearchBox wordSearchBox)
 {
     StartLetter = startLetter;
     WordSearchBox = wordSearchBox;
     maxLettersToSearchCalculator = new MaxLettersToSearchCalculator(
         StartLetter, WordSearchBox.Width, WordSearchBox.Height);
 }
Exemple #2
0
 protected BaseWordConstructor(int startLetter, WordSearchBox wordSearchBox)
 {
     StartLetter   = startLetter;
     WordSearchBox = wordSearchBox;
     maxLettersToSearchCalculator = new MaxLettersToSearchCalculator(
         StartLetter, WordSearchBox.Width, WordSearchBox.Height);
 }
 public static SearchEngine Get(IEngineData searchEngineData)
 {
     var wordSearchBox = new WordSearchBox(searchEngineData.Letters, searchEngineData.Width);
     var expectedWords = searchEngineData.ExpectedWords;
     var wordList = new WordList();
     wordList.AddWordsToList(expectedWords);
     return new SearchEngine(wordSearchBox, wordList);
 }
Exemple #4
0
        protected void TestAWordIsntFound(string wordSearchLetters, int boxWidth, int wordLength, Func <WordSearchBox, IWordConstructor> createWordConstructor)
        {
            var searchBox       = new WordSearchBox(wordSearchLetters, boxWidth);
            var wordConstructor = createWordConstructor(searchBox);
            var result          = TestAWordCheck(searchBox, wordLength, wordConstructor);

            Assert.IsFalse(result.Item2);
        }
Exemple #5
0
        public static SearchEngine Get(IEngineData searchEngineData)
        {
            var wordSearchBox = new WordSearchBox(searchEngineData.Letters, searchEngineData.Width);
            var expectedWords = searchEngineData.ExpectedWords;
            var wordList      = new WordList();

            wordList.AddWordsToList(expectedWords);
            return(new SearchEngine(wordSearchBox, wordList));
        }
Exemple #6
0
    private void ShowSearchWordBox(List <string> usedChars)
    {
        WordSearchBox wordBox = gameObject.AddComponent <WordSearchBox>();

        wordBox.InsertLetters(usedChars);
        wordBox.InsertSearchBaseGO(this.searchBase);
        //wordBox.InsertLetterGO(this.searchLetter);
        wordBox.DrawBase();
    }
 public UpWordConstructor(int startLetter, WordSearchBox wordSearchBox)
     : base(startLetter, wordSearchBox)
 {
 }
 public DiagonallyRightUpWordConstructor(int startLetter, WordSearchBox wordSearchBox)
     : base(startLetter, wordSearchBox)
 {
 }
 public UpWordConstructor(int startLetter, WordSearchBox wordSearchBox)
     : base(startLetter, wordSearchBox)
 {
 }
 public DiagonallyRightDownWordConstructor(int startLetter, WordSearchBox wordSearchBox)
     : base(startLetter, wordSearchBox)
 {
 }
 public SearchEngine(WordSearchBox wordSearchBox, WordList wordList)
 {
     this.wordSearchBox = wordSearchBox;
     this.wordList      = wordList;
 }
 public SearchEngine(WordSearchBox wordSearchBox, WordList wordList)
 {
     this.wordSearchBox = wordSearchBox;
     this.wordList = wordList;
 }
Exemple #13
0
        private Tuple <string, bool> TestAWordCheck(WordSearchBox wordSearchBox, int length, IWordConstructor wordConstructor)
        {
            var searchEngine = new SearchEngine(wordSearchBox, new WordList());

            return(searchEngine.CheckWordOfOneLengthInOneDirection(length, wordConstructor));
        }
 public DiagonallyLeftUpWordConstructor(int startLetter, WordSearchBox wordSearchBox)
     : base(startLetter, wordSearchBox)
 {
 }