Cute Chess  0.1
engineconfiguration.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 ENGINE_CONFIGURATION_H
19 #define ENGINE_CONFIGURATION_H
20 
21 #include <QString>
22 #include <QStringList>
23 #include <QVariant>
24 
25 class EngineOption;
26 
32 class LIB_EXPORT EngineConfiguration
33 {
34  public:
40  {
43  RestartOff
44  };
45 
52  EngineConfiguration(const QString& name,
53  const QString& command,
54  const QString& protocol);
56  EngineConfiguration(const QVariant& variant);
60  EngineConfiguration& operator=(EngineConfiguration&& other);
61 
64 
71  QVariant toVariant() const;
72 
78  void setName(const QString& name);
84  void setCommand(const QString& command);
90  void setWorkingDirectory(const QString& workingDir);
97  void setStderrFile(const QString& fileName);
103  void setProtocol(const QString& protocol);
104 
110  QString name() const;
116  QString command() const;
122  QString workingDirectory() const;
129  QString stderrFile() const;
135  QString protocol() const;
136 
138  QStringList arguments() const;
140  void setArguments(const QStringList& arguments);
142  void addArgument(const QString& argument);
143 
145  QStringList initStrings() const;
147  void setInitStrings(const QStringList& initStrings);
149  void addInitString(const QString& initString);
150 
156  QStringList supportedVariants() const;
161  bool supportsVariant(const QString& variant) const;
163  void setSupportedVariants(const QStringList& variants);
164 
166  QList<EngineOption*> options() const;
168  void setOptions(const QList<EngineOption*>& options);
170  void addOption(EngineOption* option);
177  void setOption(const QString& name, const QVariant& value);
178 
180  bool whiteEvalPov() const;
182  void setWhiteEvalPov(bool whiteEvalPov);
183 
185  bool pondering() const;
187  void setPondering(bool enabled);
188 
193  RestartMode restartMode() const;
195  void setRestartMode(RestartMode mode);
196 
204  bool areClaimsValidated() const;
206  void setClaimsValidated(bool validate);
207 
212  EngineConfiguration& operator=(const EngineConfiguration& other);
213 
214  private:
215  QString m_name;
216  QString m_command;
217  QString m_workingDirectory;
218  QString m_stderrFile;
219  QString m_protocol;
220  QStringList m_arguments;
221  QStringList m_initStrings;
222  QStringList m_variants;
223  QList<EngineOption*> m_options;
224  bool m_whiteEvalPov;
225  bool m_pondering;
226  bool m_validateClaims;
227  RestartMode m_restartMode;
228 };
229 
230 #endif // ENGINE_CONFIGURATION_H
The engine is always restarted between games.
Definition: engineconfiguration.h:42
The EngineConfiguration class defines a chess engine configuration.
Definition: engineconfiguration.h:32
The engine decides whether to restart.
Definition: engineconfiguration.h:41
Definition: engineoption.h:24
RestartMode
Definition: engineconfiguration.h:39