FPChess: Fix engine play with black

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4106 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
brian-ch
2015-05-01 15:56:59 +00:00
parent 5d7cc4210a
commit 7c5d6d88be
2 changed files with 8 additions and 10 deletions

View File

@ -337,6 +337,14 @@ begin
end;
Player[ComputerColor].LookAhead := spinDifficulty.Value;
if ComputerColor = C_WHITE then
begin
KCChessThread := TKCChessThread.Create(True);
KCChessThread.FreeOnTerminate := True;
KCChessThread.PlayerColor := PlayerColor;
KCChessThread.ComputerColor := ComputerColor;
KCChessThread.Resume();
end;
end;
function TKCChessModule.GetSecondPlayerName: ansistring;

View File

@ -102,22 +102,12 @@ begin
end;
procedure TWinboardChessModule.PrepareForGame;
var
CompMove: moveInCoord;
lAnimation: TChessMoveAnimation;
begin
vwinboardConn.startEngine(editEnginePatch.text);
if not vChessGame.FirstPlayerIsWhite then
begin
vwinboardConn.tellMove('go');
compMove:=vwinboardConn.engineMove;
lAnimation := TChessMoveAnimation.Create;
lAnimation.AFrom := CompMove[1];
lAnimation.ATo := CompMove[2];
vChessDrawer.AddAnimation(lAnimation);
end;
end;
initialization