Cute Chess  0.1
newgamedlg.h
1 /*
2  This file is part of Cute Chess.
3 
4  Cute Chess is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  Cute Chess is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with Cute Chess. If not, see <http://www.gnu.org/licenses/>.
16 */
17 
18 #ifndef NEWGAMEDIALOG_H
19 #define NEWGAMEDIALOG_H
20 
21 #include <QDialog>
22 #include <board/side.h>
23 #include <engineconfiguration.h>
24 
25 class ChessGame;
26 class PlayerBuilder;
29 class EngineManager;
30 
31 namespace Ui {
32  class NewGameDialog;
33 }
34 
38 class NewGameDialog : public QDialog
39 {
40  Q_OBJECT
41 
42  public:
45  {
50  };
51 
56  NewGameDialog(EngineManager* engineManager,
57  QWidget* parent = nullptr);
59  virtual ~NewGameDialog();
60 
62  ChessGame* createGame() const;
65 
66  private slots:
67  void configureEngine();
68  void onVariantChanged(const QString& variant);
69  void onEngineChanged(int index, Chess::Side = Chess::Side::NoSide);
70 
71  private:
72  void setPlayerType(Chess::Side side, PlayerType type);
73  PlayerType playerType(Chess::Side side) const;
74 
75  EngineManager* m_engineManager;
76  EngineConfigurationModel* m_engines;
77  EngineConfigurationProxyModel* m_proxyModel;
78  EngineConfiguration m_engineConfig[2];
79  Ui::NewGameDialog* ui;
80 };
81 
82 #endif // NEWGAMEDIALOG_H
A class for constructing new chess players.
Definition: playerbuilder.h:37
Definition: newgamedlg.h:49
A proxy model for sorting and filtering engine configurations.
Definition: engineconfigproxymodel.h:31
The EngineConfiguration class defines a chess engine configuration.
Definition: engineconfiguration.h:32
Definition: engineconfigurationdlg.h:30
Manages chess engines and their configurations.
Definition: enginemanager.h:29
The EngineConfigurationModel class represents a chess engine configuration based model.
Definition: engineconfigurationmodel.h:42
Definition: newgamedlg.h:47
virtual ~NewGameDialog()
Definition: newgamedlg.cpp:100
Definition: chessgame.h:38
The side or color of a chess player.
Definition: side.h:34
PlayerType
Definition: newgamedlg.h:44
ChessGame * createGame() const
Definition: newgamedlg.cpp:105
No side.
Definition: side.h:44
NewGameDialog(EngineManager *engineManager, QWidget *parent=nullptr)
Definition: newgamedlg.cpp:42
The NewGameDialog class provides a dialog for creating a new game.
Definition: newgamedlg.h:38
PlayerBuilder * createPlayerBuilder(Chess::Side side) const
Definition: newgamedlg.cpp:148