Exemple #1
0
        public void Start(GoBoard goBoard, Color playerToMove, SearchOptions searchOptions, SearchMethodType searchMethodType, OnCompletion onCompletion)
        {
            // stop existing search, if any
            if (SearchInterface != null)
            {
                Stop();
            }

            if (SearchMethodType != searchMethodType)
            {
                SearchMethodType = searchMethodType;
                SearchInterface  = SearchMethodFactory.CreateFactory(searchMethodType);
            }

            // make a private copy of the board
            Board = goBoard.Clone();

            // make a private copy of the search options
            SearchOptions = searchOptions.Clone();

            // set player to move
            PlayerToMove = playerToMove;

            // set the Nag Coordinator
            SearchInterface.SetNagCoordinator(NagCoordinator);

            // initialize the search parameters
            SearchInterface.Initialize(Board, PlayerToMove, SearchOptions, onCompletion);

            // start search
            SearchThread = new Thread(this.StartThread);
            SearchThread.Start();
        }
Exemple #2
0
        protected static void SetSearchMethod(GoBoard goBoard, SearchEngine searchEngine, List <string> parameters, string id, Worker.SendResponse proxy)
        {
            searchEngine.SetSearchMethod(SearchMethodFactory.ToType(parameters[0]));

            Respond(proxy, id);
        }