--- a/qmlfrontend/hwengine.h Fri Dec 07 13:04:00 2018 +0100
+++ b/qmlfrontend/hwengine.h Fri Dec 07 13:35:08 2018 +0100
@@ -8,25 +8,29 @@
#include "game_config.h"
class QQmlEngine;
-class PreviewImageProvider;
class EngineInstance;
+class PreviewAcceptor;
class HWEngine : public QObject {
Q_OBJECT
Q_PROPERTY(int previewHedgehogsCount READ previewHedgehogsCount NOTIFY
previewHedgehogsCountChanged)
+ Q_PROPERTY(PreviewAcceptor* previewAcceptor READ previewAcceptor WRITE
+ setPreviewAcceptor NOTIFY previewAcceptorChanged)
public:
- explicit HWEngine(QQmlEngine* engine, QObject* parent = nullptr);
+ explicit HWEngine(QObject* parent = nullptr);
~HWEngine();
- static void exposeToQML();
-
Q_INVOKABLE void getPreview();
Q_INVOKABLE EngineInstance* runQuickGame();
int previewHedgehogsCount() const;
+ PreviewAcceptor* previewAcceptor() const;
+
+ public slots:
+ void setPreviewAcceptor(PreviewAcceptor* previewAcceptor);
signals:
void previewIsRendering();
@@ -34,12 +38,13 @@
void previewHogCountChanged(int count);
void gameFinished();
void previewHedgehogsCountChanged(int previewHedgehogsCount);
+ void previewAcceptorChanged(PreviewAcceptor* previewAcceptor);
private:
QQmlEngine* m_engine;
- PreviewImageProvider* m_previewProvider;
GameConfig m_gameConfig;
int m_previewHedgehogsCount;
+ PreviewAcceptor* m_previewAcceptor;
};
#endif // HWENGINE_H