diff options
author | pommicket <pommicket@gmail.com> | 2025-08-13 13:45:54 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2025-08-13 13:45:54 -0400 |
commit | 306eff0aaf77d94f70a91d2ba8c2fe0a1046df51 (patch) | |
tree | cc8312c07994d25d9737c21c7fd22063646c46cc /quacker/macondo.h | |
parent | e43c01bd11560561daa771463c57442c3b8a761d (diff) |
Various code cleanup, fix issues with move box
Diffstat (limited to 'quacker/macondo.h')
-rw-r--r-- | quacker/macondo.h | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/quacker/macondo.h b/quacker/macondo.h index de12fe1..f34117e 100644 --- a/quacker/macondo.h +++ b/quacker/macondo.h @@ -5,35 +5,39 @@ #include "game.h" class QCheckBox; -class QTimer; -namespace Quackle { - class Game; - class MoveList; -} class MacondoBackend; struct MacondoInitOptions; class MoveBox; class Macondo : public View { Q_OBJECT public: - Macondo(Quackle::Game *, MoveBox *); + Macondo(Quackle::Game *game); ~Macondo(); - void setGame(Quackle::Game *); // stop current analysis void stop(); // should Macondo be used for simulations? bool useForSimulation() const; -signals: - void newMoves(const Quackle::MoveList *); + 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); +private slots: + void gotSimMoves(const Quackle::MoveList &moves); private: QCheckBox *m_useMacondo; Quackle::Game *m_game; MacondoBackend *m_backend; Quackle::MoveList m_moves; int m_viewingPlyNumber = 0; - MoveBox *m_moveBox; + bool m_anyUpdates = false; std::unique_ptr<MacondoInitOptions> initOptions; }; |