blob: 57f6acc9e4b6f86263256d141feb3c421d54c30e (
plain)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
#ifndef MACONDO_H
#define MACONDO_H
#include "view.h"
#include "game.h"
class QCheckBox;
class MacondoBackend;
struct MacondoInitOptions;
class MoveBox;
class Macondo : public View {
Q_OBJECT
public:
Macondo(Quackle::Game *game);
~Macondo();
// stop current analysis
void stop();
// should Macondo be used for simulations?
bool useForSimulation() const;
inline const Quackle::MoveList &getMoves() const { return m_moves; }
inline bool hasMoves() const { return !m_moves.empty(); }
inline void clearMoves() { m_moves.clear(); }
// returns whether there have been any updates to moves since last time anyUpdates() was called.
inline bool anyUpdates() {
bool any = m_anyUpdates;
m_anyUpdates = false;
return any;
}
public slots:
void simulate();
virtual void gameChanged(Quackle::Game *game);
virtual void positionChanged(const Quackle::GamePosition *position);
private slots:
void gotSimMoves(const Quackle::MoveList &moves);
private:
QCheckBox *m_useMacondo;
Quackle::Game *m_game;
MacondoBackend *m_backend;
Quackle::MoveList m_moves;
Quackle::MoveList m_movesFromKibitzer;
int m_viewingPlyNumber = 0;
bool m_anyUpdates = false;
std::unique_ptr<MacondoInitOptions> initOptions;
};
#endif
|