-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathInitChessProgram.cpp
73 lines (64 loc) · 1.86 KB
/
InitChessProgram.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include "stdafx.h"
#include "data.h"
#include "chess.h"
#include "Resource.h"
#include "pregen.h"
void //重新初始化象棋引擎, 这之前引擎已打开了
InitChessProgram(ChessProgramState *cps) {
//dispboard_t *pDis = OBS[cps->table];
dispboard_t* pDis = (dispboard_t*)cps->pDis;
//if (pDis->noChessProgram){
// return;
//}
//cps->table = pDis->table;
/* pDis->hintRequested = FALSE;
pDis->bookRequested = FALSE; */
switch(cps->ucci){
case UCCI_UCCI_ms:
case UCCI_UCCI_OLD:
//1, 先将原先的停止一下
//SendToProgram("stop\n", cps);
//SendToProgram("stop\n",cps);
SendToProgram(L"stop\n", cps);
SendToProgram(L"uccinewgame\n", cps); //重新开始一局
break;
//
case UCCI_GGchess:
SendToProgram(L"stop\n", cps);
SendToProgram(L"ucinewgame\n", cps); //重新开始一局
break;
//
case UCCI_CYC105:
SendToProgram(L"stop\n", cps);
SendToProgram(L"uccinewgame\n", cps); //重新开始一局 //ccinewgame
SendToProgram(L"ucci\n", cps);
//[GUI]stop
//[GUI]ccinewgame
//[GUI]cci
break;
//
case UCCI_QianHong:
break;
//
default:
SendToProgram(L"stop\n", cps);
SendToProgram(L"uccinewgame\n", cps); //重新开始一局
break;
}
SendControlParameterToCps(cps);
//cps->UCCI_initDone = TRUE;
}
void //初始化程序状态
ClearProgramStats(void){
/* Init programStats */
//DIS.programStats.movelist[0] = 0;
//DIS.programStats.depth = 0;
//DIS.programStats.nr_moves = 0;
//DIS.programStats.moves_left = 0;
//DIS.programStats.nodes = 0;
//DIS.programStats.time = 100;
//DIS.programStats.score = 0;
//DIS.programStats.got_only_move = 0;
//DIS.programStats.got_fail = 0;
//DIS.programStats.line_is_book = 0;
}