author | alfadur |
Mon, 19 Nov 2018 09:37:53 +0300 | |
changeset 14242 | 81fba21495a5 |
parent 14159 | 8354b390f1a2 |
child 14278 | 645e4591361f |
permissions | -rw-r--r-- |
14148 | 1 |
#ifndef HWENGINE_H |
2 |
#define HWENGINE_H |
|
3 |
||
4 |
#include <QList> |
|
5 |
#include <QObject> |
|
6 |
||
14159
8354b390f1a2
Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
14148
diff
changeset
|
7 |
#include "engine_interface.h" |
8354b390f1a2
Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
14148
diff
changeset
|
8 |
#include "game_config.h" |
14148 | 9 |
|
10 |
class QQmlEngine; |
|
11 |
class PreviewImageProvider; |
|
12 |
||
13 |
class HWEngine : public QObject { |
|
14 |
Q_OBJECT |
|
15 |
||
16 |
Q_PROPERTY(int previewHedgehogsCount READ previewHedgehogsCount NOTIFY |
|
17 |
previewHedgehogsCountChanged) |
|
18 |
||
19 |
public: |
|
20 |
explicit HWEngine(QQmlEngine* engine, QObject* parent = nullptr); |
|
21 |
~HWEngine(); |
|
22 |
||
23 |
static void exposeToQML(); |
|
24 |
||
25 |
Q_INVOKABLE void getPreview(); |
|
26 |
Q_INVOKABLE void runQuickGame(); |
|
27 |
||
28 |
int previewHedgehogsCount() const; |
|
29 |
||
30 |
signals: |
|
31 |
void previewIsRendering(); |
|
32 |
void previewImageChanged(); |
|
33 |
void previewHogCountChanged(int count); |
|
34 |
void gameFinished(); |
|
35 |
void previewHedgehogsCountChanged(int previewHedgehogsCount); |
|
36 |
||
37 |
private: |
|
38 |
QQmlEngine* m_engine; |
|
39 |
PreviewImageProvider* m_previewProvider; |
|
40 |
GameConfig m_gameConfig; |
|
41 |
QByteArray m_seed; |
|
42 |
int m_previewHedgehogsCount; |
|
43 |
}; |
|
44 |
||
45 |
#endif // HWENGINE_H |