-
Notifications
You must be signed in to change notification settings - Fork 12
/
SendBoard.cpp
43 lines (38 loc) · 1.09 KB
/
SendBoard.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include "stdafx.h"
#include "data.h"
#include "chess.h"
#include "Resource.h"
#include "pregen.h"
void //发送一个盘面到引擎
SendBoard(ChessProgramState *cps,int moveNum){
TCHAR message[MSG_SIZ];
TCHAR fen[MSG_SIZ];
dispboard_t* pDis = (dispboard_t*)cps->pDis;
/*PositionToFEN(fen,moveNum,cps->ucci);*/
switch(cps->ucci){
case UCCI_UCCI_ms:
case UCCI_UCCI_OLD:
//StringCbPrintf(message,MSG_SIZ,"position fen %s\n", fen);
////free(fen);
//SendToProgram(message, cps);
//这个就不用了
break;
case UCCI_CYC105:
break;
case UCCI_QianHong:
swprintf_s(message,MSG_SIZ,L"FEN %s\n", fen);
//free(fen);
SendToProgram(message, cps);
break;
default:
PositionToFEN(pDis, fen,moveNum,cps->ucci);
if (cps->useSetboard) {
swprintf_s(message, MSG_SIZ, L"setboard %s\n", fen);
SendToProgram(message, cps);
free(fen);
}
else {
}
break;
}
}