author | nemo |
Wed, 05 Dec 2018 09:38:31 -0500 | |
branch | 0.9.25 |
changeset 14366 | 2ab312c47dc3 |
parent 14298 | 00b56ec8b7df |
child 14371 | 90bd2c331703 |
permissions | -rw-r--r-- |
14143 | 1 |
#ifndef HWENGINE_H |
2 |
#define HWENGINE_H |
|
3 |
||
4 |
#include <QList> |
|
5 |
#include <QObject> |
|
6 |
||
14154
8354b390f1a2
Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
14143
diff
changeset
|
7 |
#include "engine_interface.h" |
8354b390f1a2
Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
14143
diff
changeset
|
8 |
#include "game_config.h" |
14143 | 9 |
|
10 |
class QQmlEngine; |
|
11 |
class PreviewImageProvider; |
|
14298 | 12 |
class EngineInstance; |
14143 | 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(); |
|
14298 | 27 |
Q_INVOKABLE EngineInstance* runQuickGame(); |
14143 | 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 |