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
26class ChessGame;
27class PlayerBuilder;
30class EngineManager;
31
32namespace Ui {
33 class NewGameDialog;
34}
35
39class NewGameDialog : public QDialog
40{
41 Q_OBJECT
42
43 public:
46 {
51 };
52
57 NewGameDialog(EngineManager* engineManager,
58 QWidget* parent = nullptr);
60 virtual ~NewGameDialog();
61
63 ChessGame* createGame() 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;
79 EngineConfiguration m_engineConfig[2];
80 Ui::NewGameDialog* ui;
81};
82
83#endif // NEWGAMEDIALOG_H
Definition chessgame.h:39
The side or color of a chess player.
Definition side.h:36
@ NoSide
No side.
Definition side.h:45
The EngineConfigurationModel class represents a chess engine configuration based model.
Definition engineconfigurationmodel.h:44
A proxy model for sorting and filtering engine configurations.
Definition engineconfigproxymodel.h:33
The EngineConfiguration class defines a chess engine configuration.
Definition engineconfiguration.h:34
Manages chess engines and their configurations.
Definition enginemanager.h:31
PlayerType
Definition newgamedlg.h:46
@ CPU
Definition newgamedlg.h:50
@ Human
Definition newgamedlg.h:48
virtual ~NewGameDialog()
Definition newgamedlg.cpp:101
PlayerBuilder * createPlayerBuilder(Chess::Side side) const
Definition newgamedlg.cpp:149
NewGameDialog(EngineManager *engineManager, QWidget *parent=nullptr)
Definition newgamedlg.cpp:43
ChessGame * createGame() const
Definition newgamedlg.cpp:106
A class for constructing new chess players.
Definition playerbuilder.h:39