-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathSendTimeControl.cpp
73 lines (68 loc) · 1.84 KB
/
SendTimeControl.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 //发送时间控制到引擎中
SendTimeControl(ChessProgramState *cps,int mps,long tc,int inc,int sd,int st){
//char buf[MSG_SIZ];
int seconds = (tc / 1000) % 60;
switch(cps->ucci){
case UCCI_UCCI_ms: //象堡协议
case UCCI_UCCI_OLD:
break;
//
case UCCI_GGchess:
break;
//
case UCCI_CYC105:
break;
//
case UCCI_QianHong: //浅红协议
break;
//
default:
break;
}
//if (st > 0) {
// /* Set exact time per move, normally using st command */
// if (cps->stKludge) {
// /* GNU Chess 4 has no st command; uses level in a nonstandard way */
// seconds = st % 60;
// if (seconds == 0) {
// sprintf(buf, "level 1 %d\n", st/60);
// }
// else {
// sprintf(buf, "level 1 %d:%02d\n", st/60, seconds);
// }
// }
// else {
// sprintf(buf, "st %d\n", st);
// }
//}
//else {
// /* Set conventional or incremental time control, using level command */
// if (seconds == 0) {
// /* Note old gnuchess bug -- minutes:seconds used to not work.
// Fixed in later versions, but still avoid :seconds
// when seconds is 0. */
// sprintf(buf, "level %d %ld %d\n", mps, tc/60000, inc/1000);
// }
// else {
// sprintf(buf, "level %d %ld:%02d %d\n", mps, tc/60000,
// seconds, inc/1000);
// }
//}
//SendToProgram(buf, cps);
///* Orthoganally (except for GNU Chess 4), limit time to st seconds */
///* Orthogonally, limit search to given depth */
//if (sd > 0) {
// if (cps->sdKludge) {
// sprintf(buf, "depth\n%d\n", sd);
// }
// else {
// sprintf(buf, "sd %d\n", sd);
// }
// SendToProgram(buf, cps);
//}
}