-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEngine.h
31 lines (27 loc) · 835 Bytes
/
Engine.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#pragma once
#include <QProcess>
#include <QFileInfo>
#include "Common.h"
constexpr signed char operator "" _c(unsigned long long arg) noexcept
{
return static_cast<signed char>(arg);
}
class Engine
{
public:
Engine();
virtual ~Engine();
virtual QProcess* RunProcess(QObject *parentObject, const QString& engineExe);
void Quit() const;
virtual void SetFEN(std::string fen);
virtual EngineProtocol GetType() = 0;
virtual void StartGame(QString variant = "") = 0;
virtual void Move() = 0;
virtual void Move(signed char x1, signed char y1, signed char x2, signed char y2, char promotion = ' ') = 0;
virtual QByteArray AddMove(signed char x1, signed char y1, signed char x2, signed char y2, char promotion = ' ') = 0;
protected:
QProcess *_process = nullptr;
std::vector<QByteArray> _moves;
std::string _fen;
private:
};