author | Wuzzy <Wuzzy2@mail.ru> |
Wed, 05 Dec 2018 15:47:34 +0100 | |
branch | 0.9.25 |
changeset 14372 | 40dd8eb60d54 |
parent 14303 | 00b56ec8b7df |
child 14376 | 90bd2c331703 |
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; |
|
14303 | 12 |
class EngineInstance; |
14148 | 13 |
|
14 |
class HWEngine : public QObject { |
|
15 |
Q_OBJECT |
|
16 |
||
17 |
Q_PROPERTY(int previewHedgehogsCount READ previewHedgehogsCount NOTIFY |
|
18 |
previewHedgehogsCountChanged) |
|
19 |
||
20 |
public: |
|
21 |
explicit HWEngine(QQmlEngine* engine, QObject* parent = nullptr); |
|
22 |
~HWEngine(); |
|
23 |
||
24 |
static void exposeToQML(); |
|
25 |
||
26 |
Q_INVOKABLE void getPreview(); |
|
14303 | 27 |
Q_INVOKABLE EngineInstance* runQuickGame(); |
14148 | 28 |
|
29 |
int previewHedgehogsCount() const; |
|
30 |
||
31 |
signals: |
|
32 |
void previewIsRendering(); |
|
33 |
void previewImageChanged(); |
|
34 |
void previewHogCountChanged(int count); |
|
35 |
void gameFinished(); |
|
36 |
void previewHedgehogsCountChanged(int previewHedgehogsCount); |
|
37 |
||
38 |
private: |
|
39 |
QQmlEngine* m_engine; |
|
40 |
PreviewImageProvider* m_previewProvider; |
|
41 |
GameConfig m_gameConfig; |
|
42 |
int m_previewHedgehogsCount; |
|
43 |
}; |
|
44 |
||
45 |
#endif // HWENGINE_H |