6
#ifndef QGO_INTERFACE_H
7
#define QGO_INTERFACE_H
9
#undef SHOW_INTERNAL_TIME
15
#include "gs_globals.h"
25
#include "mainwindow.h"
26
//#include "qgoclient_interface.h"
40
// 15 Game 43 I: xxxx (4 223 16) vs yyyy (5 59 13)
52
QString mv_col; // T..Time, B..Black, W..White, I..Init
59
class qGoBoard : public QObject, public Misc<QString>
64
qGoBoard(qGoIF*, qGo*);
66
int get_id() const { return id; }
67
void set_id(int i) { id = i; gd.gameNumber = i; }
68
GameData get_gameData() { return gd; }
69
void set_title(const QString&);
70
bool get_haveTitle() { return haveTitle; }
71
void set_komi(const QString&);
72
void set_freegame(bool);
73
bool get_havegd() { return have_gameData; }
74
bool get_sentmovescmd() { return sent_movescmd; }
75
void set_sentmovescmd(bool m) { sent_movescmd = m; }
76
bool get_adj() { return adjourned; }
77
QString get_bplayer() { return gd.playerBlack; }
78
QString get_wplayer() { return gd.playerWhite; }
79
void set_adj(bool a) { adjourned = a; }
80
void set_game(Game *g);
83
GameMode get_Mode() { return gameMode; }
84
void set_move(StoneColor, QString, QString);
85
void send_kibitz(const QString);
86
MainWindow *get_win() { return win; }
87
void initGame() { win->getBoard()->initGame(&gd); }
88
void setGameData() {win->getBoard()->setGameData(&gd); }
89
void setMode() { win->getBoard()->setMode(gameMode); }
90
void setTimerInfo(const QString&, const QString&, const QString&, const QString&);
91
void timerEvent(QTimerEvent*);
92
QString secToTime(int);
95
void set_gamePaused(bool p) { game_paused = p; }
96
int get_boardsize() { return gd.size; }
97
int get_mvcount() { return mv_counter; }
98
void set_myColorIsBlack(bool b);
99
bool get_myColorIsBlack() { return myColorIsBlack; }
100
void set_requests(const QString &handicap, const QString &komi, assessType);
101
void check_requests();
102
QString get_reqKomi() { return req_komi; }
103
QString get_currentKomi() { return QString::number(gd.komi); }
104
void dec_mv_counter() { mv_counter--; }
105
int get_mv_counter() { return mv_counter; }
106
bool get_requests_set() { return requests_set; }
107
qGo* get_qgo() { return qgo; }
108
void set_gsName(GSName g) { gsName = g; }
109
void addtime_b(int m);
110
void addtime_w(int m);
111
void set_myName(const QString &n) { myName = n; }
112
void clearObserverList() { win->getListView_observers()->clear(); }
113
void playComputer(StoneColor);
116
bool ExtendedTeachingGame;
127
// void signal_closeevent(int);
128
void signal_sendcommand(const QString&, bool);
129
void signal_2passes(const QString&, const QString&);
133
void slot_closeevent();
134
void slot_sendcomment(const QString&);
137
void slot_addStone(enum StoneColor, int, int);
138
void slot_stoneComputer(enum StoneColor, int, int);
139
void slot_PassComputer(StoneColor c) ;
140
void slot_UndoComputer(StoneColor c) ;
141
void slot_DoneComputer() ;
143
void slot_doResign();
145
void slot_doAdjourn();
147
void slot_doRefresh();
150
void slot_addtimePauseW();
151
void slot_addtimePauseB();
154
void slot_ttOpponentSelected(const QString&);
155
void slot_ttControls(bool);
156
void slot_ttMark(bool);
172
int stated_mv_count ;
176
QString b_stones, w_stones;
177
QString req_handicap;
185
#ifdef SHOW_INTERNAL_TIME
192
class qGoIF : public QObject
199
bool set_observe(QString);
201
void set_myName(const QString &n) { myName = n; }
202
qGo *get_qgo() { return qgo; };
203
void set_gsName(GSName n) { gsName = n; }
204
void set_localboard(QString file=0);
205
void set_localgame();
206
void openPreferences(int tab=-1);
207
QWidget *get_parent() { return parent; }
210
void signal_sendcommand(const QString&, bool);
211
void signal_addToObservationList(int);
215
void slot_move(GameInfo*);
216
void slot_move(Game*);
217
void slot_computer_game(QNewGameDlg*);
218
void slot_kibitz(int, const QString&, const QString&);
219
void slot_title(const QString&);
220
void slot_komi(const QString&, const QString&, bool);
221
void slot_freegame(bool);
222
void slot_matchcreate(const QString&, const QString&);
223
void slot_removestones(const QString&, const QString&);
224
void slot_undo(const QString&, const QString&);
225
void slot_result(const QString&, const QString&, bool, const QString&);
226
void slot_matchsettings(const QString&, const QString&, const QString&, assessType);
227
void slot_requestDialog(const QString&, const QString&, const QString&, const QString&);
228
void slot_timeAdded(int, bool);
231
// void slot_closeevent(int) {};
232
void slot_closeevent();
233
void slot_sendcommand(const QString&, bool);
236
bool parse_move(int src, GameInfo* gi=0, Game* g=0, QString txt=0);
241
// actual pointer, for speedup reason
244
QList<qGoBoard> *boardlist;
246
int localBoardCounter;
247
// int lockObserveCmd;