Cute Chess  0.1
engineconfiguration.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 ENGINE_CONFIGURATION_H
20 #define ENGINE_CONFIGURATION_H
21 
22 #include <QString>
23 #include <QStringList>
24 #include <QVariant>
25 
26 class EngineOption;
27 
33 class LIB_EXPORT EngineConfiguration
34 {
35  public:
41  {
44  RestartOff
45  };
46 
53  EngineConfiguration(const QString& name,
54  const QString& command,
55  const QString& protocol);
57  EngineConfiguration(const QVariant& variant);
61  EngineConfiguration& operator=(EngineConfiguration&& other);
62 
65 
72  QVariant toVariant() const;
73 
79  void setName(const QString& name);
85  void setCommand(const QString& command);
91  void setWorkingDirectory(const QString& workingDir);
98  void setStderrFile(const QString& fileName);
104  void setProtocol(const QString& protocol);
105 
111  QString name() const;
117  QString command() const;
123  QString workingDirectory() const;
130  QString stderrFile() const;
136  QString protocol() const;
137 
139  QStringList arguments() const;
141  void setArguments(const QStringList& arguments);
143  void addArgument(const QString& argument);
144 
146  QStringList initStrings() const;
148  void setInitStrings(const QStringList& initStrings);
150  void addInitString(const QString& initString);
151 
157  QStringList supportedVariants() const;
162  bool supportsVariant(const QString& variant) const;
164  void setSupportedVariants(const QStringList& variants);
165 
167  QList<EngineOption*> options() const;
169  void setOptions(const QList<EngineOption*>& options);
171  void addOption(EngineOption* option);
178  void setOption(const QString& name, const QVariant& value);
179 
181  bool whiteEvalPov() const;
183  void setWhiteEvalPov(bool whiteEvalPov);
184 
186  bool pondering() const;
188  void setPondering(bool enabled);
189 
194  RestartMode restartMode() const;
196  void setRestartMode(RestartMode mode);
197 
205  bool areClaimsValidated() const;
207  void setClaimsValidated(bool validate);
208 
213  EngineConfiguration& operator=(const EngineConfiguration& other);
214 
215  private:
216  QString m_name;
217  QString m_command;
218  QString m_workingDirectory;
219  QString m_stderrFile;
220  QString m_protocol;
221  QStringList m_arguments;
222  QStringList m_initStrings;
223  QStringList m_variants;
224  QList<EngineOption*> m_options;
225  bool m_whiteEvalPov;
226  bool m_pondering;
227  bool m_validateClaims;
228  RestartMode m_restartMode;
229 };
230 
231 #endif // ENGINE_CONFIGURATION_H
The engine is always restarted between games.
Definition: engineconfiguration.h:43
The EngineConfiguration class defines a chess engine configuration.
Definition: engineconfiguration.h:33
The engine decides whether to restart.
Definition: engineconfiguration.h:42
Definition: engineoption.h:25
RestartMode
Definition: engineconfiguration.h:40