コード例 #1
0
        List <GoWord> GivenGoWordsForMainWord(string mainWord, params string[] goWordsList)
        {
            var goWordsReturn = new List <GoWord>();

            foreach (var word in goWordsList)
            {
                goWordsReturn.Add(new GoWord()
                {
                    Word = word
                });
            }

            goWordFinder.FindWords(mainWord, Arg.Any <AiCandidate>()).Returns(goWordsReturn);

            return(goWordsReturn);
        }
コード例 #2
0
        void ProcessMainWord(string mainWord)
        {
            var goWords = goWordFinder.FindWords(mainWord, currentCandidate);

            if (goWords.All(w => wordValidator.IsWord(w.Word)))
            {
                var score = goScorer.ScoreGo(goWords);
                ValidGoes.Add(new AiValidGo()
                {
                    MainWord  = mainWord.ToUpper(),
                    Candidate = currentCandidate,
                    GoWords   = goWords,
                    Score     = score
                });
            }
        }