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(); }
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(); }