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