diff options
author | pommicket <pommicket@gmail.com> | 2025-08-08 18:20:43 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2025-08-08 18:20:43 -0400 |
commit | 4c9d6ed3024d7869c427a7f6bd2f4f61feba027d (patch) | |
tree | 825cb60768ad68870140eb7981d9080b174e5981 /quacker/macondobackend.h | |
parent | 551c51c02649aeb38d72002d6bb70b58dbee1eb2 (diff) |
start extracting plays
Diffstat (limited to 'quacker/macondobackend.h')
-rw-r--r-- | quacker/macondobackend.h | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/quacker/macondobackend.h b/quacker/macondobackend.h index dfda0c5..c8e07fa 100644 --- a/quacker/macondobackend.h +++ b/quacker/macondobackend.h @@ -1,18 +1,13 @@ -#ifndef MACONDO_BACKEND_H_ -#define MACONDO_BACKEND_H_ +#ifndef MACONDO_BACKEND_H +#define MACONDO_BACKEND_H -#include <QObject> #include <QProcess> namespace Quackle { class Game; } -enum class MacondoCommand { - None, - Simulate, - Solve, -}; +class QTimer; class MacondoBackend: public QObject { Q_OBJECT @@ -30,19 +25,26 @@ public: void simulate(const SimulateOptions &); ~MacondoBackend(); std::string getSimResults(); - inline MacondoCommand command() const { return m_command; } protected slots: void processStarted(); void processFinished(int, QProcess::ExitStatus); + void timer(); private: + enum class Command { + None, + Simulate, + Solve, + }; void loadGCG(); void killProcess(); std::string m_execPath; std::string m_tempGCG; QProcess *m_process = nullptr; + QTimer *m_updateTimer = nullptr; bool m_runningSimulation = false; Quackle::Game *m_game; - MacondoCommand m_command = MacondoCommand::None; + QByteArray m_processOutput; + Command m_command = Command::None; }; #endif |