DroidFish: Fixed to work with CuckooChess changes.

This commit is contained in:
Peter Osterlund 2012-07-15 11:00:43 +00:00
parent ab87bb9ae8
commit 6bf1886e71

View File

@ -20,6 +20,7 @@ package org.petero.droidfish.engine.cuckoochess;
import chess.Book;
import chess.ComputerPlayer;
import chess.History;
import chess.Move;
import chess.MoveGen;
import chess.Piece;
@ -48,6 +49,7 @@ public class DroidEngineControl {
private final Object threadMutex;
Search sc;
TranspositionTable tt;
History ht;
MoveGen moveGen;
Position pos;
@ -118,6 +120,7 @@ public class DroidEngineControl {
this.os = os;
threadMutex = new Object();
setupTT();
ht = new History();
moveGen = new MoveGen();
}
@ -161,6 +164,7 @@ public class DroidEngineControl {
final public void newGame() {
randomSeed = rndGen.nextLong();
tt.clear();
ht.init();
}
/**
@ -220,7 +224,7 @@ public class DroidEngineControl {
final private void startThread(final int minTimeLimit, final int maxTimeLimit,
int maxDepth, final int maxNodes) {
synchronized (threadMutex) {} // Must not start new search until old search is finished
sc = new Search(pos, posHashList, posHashListSize, tt);
sc = new Search(pos, posHashList, posHashListSize, tt, ht);
sc.timeLimit(minTimeLimit, maxTimeLimit);
sc.setListener(new SearchListener(os));
sc.setStrength(strength, randomSeed);