1 /********************************************************************
3 * Copyright (C) 2008 Davide Pesavento
5 * This file is part of GoMoku3D.
7 * GoMoku3D is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * GoMoku3D is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with GoMoku3D. If not, see <http://www.gnu.org/licenses/>.
20 *******************************************************************/
25 #include <QMainWindow>
26 #include <QModelIndex>
29 #include <QDockWidget>
32 #include "PlayerInfo.h"
33 #include "ui_MainWindow.h"
38 class SettingsManager
;
46 class MainWindow
: public QMainWindow
, private Ui_MainWindow
50 friend class OnlineDialog
;
51 friend class ServerSettingsDialog
;
56 QModelIndex
actualViewIndex() const;
57 bool isOnlineGame() const;
62 void turn(int playerId
);
63 void drawMove(Move move
);
64 void undoMoves(QModelIndex index
);
65 void showPastGameStatus(QModelIndex index
);
66 void newStandAloneGame();
69 void playerWin(int playerId
);
70 void playersDraw(QList
<int> playersIds
);
75 void showPreferences();
81 SettingsManager
*_settings
;
82 QList
<PlayerInfo
> _playersInfo
;
83 Suggester
*_suggester
;
84 RenderWidget
*_render
;
86 HistoryModel
*_history
;
87 QTableView
*_historyView
;
89 PlayersWidget
*_playersWidget
;
90 QModelIndex _actualViewIndex
;
91 int _actualPlayerIndex
;
92 bool _isStandAloneGame
;
95 bool _isDedicatedServer
;
97 bool askUserConfirmation();
98 void disableOnEndGame();
99 void resetOnNewGame();
100 void connectAISkillSlider(QList
<Player
*> players
);