-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathSetGameInfo.cpp
More file actions
163 lines (151 loc) · 7.48 KB
/
Copy pathSetGameInfo.cpp
File metadata and controls
163 lines (151 loc) · 7.48 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
#include "stdafx.h"
#include "data.h"
#include "chess.h"
#include "Resource.h"
#include "pregen.h"
//char *
//TimeControlTagValue(){
// char buf[MSG_SIZ];
// if (!appData->clockMode) {
// StringCbCopy(buf,MSG_SIZ,"-");
// } else if (DIS.movesPerSession > 0) {
// StringCbPrintf(buf,MSG_SIZ,"%d/%ld", DIS.movesPerSession, DIS.timeControl/1000);
// } else if (DIS.timeIncrement == 0) {
// StringCbPrintf(buf,MSG_SIZ,"%ld", DIS.timeControl/1000);
// } else {
// StringCbPrintf(buf,MSG_SIZ,"%ld+%ld", DIS.timeControl/1000, DIS.timeIncrement/1000);
// }
// return StrSave(buf);
//}
void
SetGameInfo(){
/* This routine is used only for certain modes */
//VariantClass v = DIS.pgn.variant;
//ClearGameInfo(&DIS.pgn);
//DIS.pgn.variant = v;
//switch (DIS.gameMode) {
// case MachinePlaysWhite:
// //DIS.gameInfo.event = StrSave("Computer chess game"); IcsObserving
// StringCbPrintf(DIS.pgn.GameEvent,sizeof(DIS.pgn.GameEvent),"Computer chess game");
// //DIS.gameInfo.site = StrSave(HostName());
// StringCbPrintf(DIS.pgn.site,sizeof(DIS.pgn.site),HostName());
// //DIS.gameInfo.date = PGNDate();
// //StringCbPrintf(DIS.GGQJ.date,sizeof(DIS.GGQJ.date),PGNDate());
// PGNDate(DIS.pgn.date);
// //DIS.gameInfo.round = StrSave("-");
// StringCbPrintf(DIS.pgn.round,sizeof(DIS.pgn.round),"-");
// //DIS.gameInfo.white = StrSave(DIS.first.tidy);
// StringCbPrintf(DIS.pgn.Rname,sizeof(DIS.pgn.Rname),DIS.first.tidy);
// //DIS.gameInfo.black = StrSave(UserName());
// StringCbPrintf(DIS.pgn.Bname,sizeof(DIS.pgn.Bname),UserName());
// //DIS.gameInfo.timeControl = TimeControlTagValue();
// //StringCbPrintf(DIS.GGQJ.timeControl,sizeof(DIS.GGQJ.timeControl),TimeControlTagValue());
// TimeControlTagValue(DIS.pgn.timeControl);
// break;
// case MachinePlaysBlack:
// //DIS.gameInfo.event = StrSave("Computer chess game");
// StringCbPrintf(DIS.pgn.GameEvent,sizeof(DIS.pgn.GameEvent),"Computer chess game");
// //DIS.gameInfo.site = StrSave(HostName());
// StringCbPrintf(DIS.pgn.site,sizeof(DIS.pgn.site),HostName());
// //DIS.gameInfo.date = PGNDate();
// //StringCbPrintf(DIS.GGQJ.date,sizeof(DIS.GGQJ.date),PGNDate());
// PGNDate(DIS.pgn.date);
// //DIS.gameInfo.round = StrSave("-");
// StringCbPrintf(DIS.pgn.round,sizeof(DIS.pgn.round),"-");
// //DIS.gameInfo.white = StrSave(UserName());
// StringCbPrintf(DIS.pgn.Rname,sizeof(DIS.pgn.Rname),UserName());
// //DIS.gameInfo.black = StrSave(DIS.first.tidy);
// StringCbPrintf(DIS.pgn.Bname,sizeof(DIS.pgn.Bname),DIS.first.tidy);
// //DIS.gameInfo.timeControl = TimeControlTagValue();
// //StringCbPrintf(DIS.GGQJ.timeControl,sizeof(DIS.GGQJ.timeControl),TimeControlTagValue());
// TimeControlTagValue(DIS.pgn.timeControl);
// break;
// case TwoMachinesPlay:
// //DIS.gameInfo.event = StrSave("Computer chess game");
// StringCbPrintf(DIS.pgn.GameEvent,sizeof(DIS.pgn.GameEvent),"Computer chess game");
// //DIS.gameInfo.site = StrSave(HostName());
// StringCbPrintf(DIS.pgn.site,sizeof(DIS.pgn.site),HostName());
// //DIS.gameInfo.date = PGNDate();
// //StringCbPrintf(DIS.GGQJ.date,sizeof(DIS.GGQJ.date),PGNDate());
// PGNDate(DIS.pgn.date);
// if (DIS.matchGame > 0) {
// char buf[MSG_SIZ];
// // sprintf(buf, "%d", matchGame);
// StringCbPrintf(buf,MSG_SIZ,"%d", DIS.matchGame);
// //DIS.gameInfo.round = StrSave(buf);
// StringCbPrintf(DIS.pgn.round,sizeof(DIS.pgn.round),buf);
// }
// else {
// //DIS.gameInfo.round = StrSave("-");
// StringCbPrintf(DIS.pgn.round,sizeof(DIS.pgn.round),"-");
// }
// //if (DIS.first.twoMachinesColor[0] == 'w') {
// //DIS.gameInfo.white = StrSave(DIS.first.tidy);
// StringCbPrintf(DIS.pgn.Rname,sizeof(DIS.pgn.Rname),DIS.first.tidy);
// //DIS.gameInfo.black = StrSave(DIS.second.tidy);
// StringCbPrintf(DIS.pgn.Bname,sizeof(DIS.pgn.Bname),DIS.second.tidy);
// //}
// //else {
// // //DIS.gameInfo.white = StrSave(DIS.second.tidy);
// // StringCbPrintf(DIS.GGQJ.Rname,sizeof(DIS.GGQJ.Rname),DIS.second.tidy);
// // //DIS.gameInfo.black = StrSave(DIS.first.tidy);
// // StringCbPrintf(DIS.GGQJ.Bname,sizeof(DIS.GGQJ.Bname),DIS.first.tidy);
// //}
// //DIS.gameInfo.timeControl = TimeControlTagValue();
// //StringCbPrintf(DIS.GGQJ.timeControl,sizeof(DIS.GGQJ.timeControl),TimeControlTagValue());
// TimeControlTagValue(DIS.pgn.timeControl);
// break;
// case EditGame:
// //DIS.gameInfo.event = StrSave("Edited game");
// StringCbPrintf(DIS.pgn.GameEvent,sizeof(DIS.pgn.GameEvent),"Edited game");
// //DIS.gameInfo.site = StrSave(HostName());
// StringCbPrintf(DIS.pgn.site,sizeof(DIS.pgn.site),HostName());
// //DIS.gameInfo.date = PGNDate();
// //StringCbPrintf(DIS.GGQJ.date,sizeof(DIS.GGQJ.date),PGNDate());
// PGNDate(DIS.pgn.date);
// //DIS.gameInfo.round = StrSave("-");
// StringCbPrintf(DIS.pgn.round,sizeof(DIS.pgn.round),"-");
// //DIS.gameInfo.white = StrSave("-");
// StringCbPrintf(DIS.pgn.Rname,sizeof(DIS.pgn.Rname),"-");
// //DIS.gameInfo.black = StrSave("-");
// StringCbPrintf(DIS.pgn.Bname,sizeof(DIS.pgn.Bname),"-");
// break;
// case EditPosition:
// //DIS.gameInfo.event = StrSave("Edited position");
// StringCbPrintf(DIS.pgn.GameEvent,sizeof(DIS.pgn.GameEvent),"Edited position");
// //DIS.gameInfo.site = StrSave(HostName());
// StringCbPrintf(DIS.pgn.site,sizeof(DIS.pgn.site),HostName());
// //DIS.gameInfo.date = PGNDate();
// //StringCbPrintf(DIS.GGQJ.date,sizeof(DIS.GGQJ.date),PGNDate());
// PGNDate(DIS.pgn.date);
// //DIS.gameInfo.round = StrSave("-");
// StringCbPrintf(DIS.pgn.round,sizeof(DIS.pgn.round),"-");
// //DIS.gameInfo.white = StrSave("-");
// StringCbPrintf(DIS.pgn.Rname,sizeof(DIS.pgn.Rname),"-");
// //DIS.gameInfo.black = StrSave("-");
// StringCbPrintf(DIS.pgn.Bname,sizeof(DIS.pgn.Bname),"-");
// break;
// case IcsPlayingWhite:
// case IcsPlayingBlack:
// case IcsObserving:
// case IcsExamining:
// break;
// case PlayFromGameFile:
// //DIS.gameInfo.event = StrSave("Game from non-PGN file");
// StringCbPrintf(DIS.pgn.GameEvent,sizeof(DIS.pgn.GameEvent),"Game from non-PGN file");
// //DIS.gameInfo.site = StrSave(HostName());
// StringCbPrintf(DIS.pgn.site,sizeof(DIS.pgn.site),HostName());
// //DIS.gameInfo.date = PGNDate();
// //StringCbPrintf(DIS.GGQJ.date,sizeof(DIS.GGQJ.date),PGNDate());
// PGNDate(DIS.pgn.date);
// //DIS.gameInfo.round = StrSave("-");
// StringCbPrintf(DIS.pgn.round,sizeof(DIS.pgn.round),"-");
// //DIS.gameInfo.white = StrSave("?");
// StringCbPrintf(DIS.pgn.Rname,sizeof(DIS.pgn.Rname),"?");
// //DIS.gameInfo.black = StrSave("?");
// StringCbPrintf(DIS.pgn.Bname,sizeof(DIS.pgn.Bname),"?");
// break;
// default:
// break;
//}
}