author | raptor <buckyballreaction@gmail.com> |
Tue, 13 Aug 2019 13:20:28 -0600 | |
branch | 0.9.25 |
changeset 15353 | 9a545985360b |
parent 14319 | 00b56ec8b7df |
child 14392 | 90bd2c331703 |
permissions | -rw-r--r-- |
14164 | 1 |
#ifndef HWENGINE_H |
2 |
#define HWENGINE_H |
|
3 |
||
4 |
#include <QList> |
|
5 |
#include <QObject> |
|
6 |
||
14175
8354b390f1a2
Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
14164
diff
changeset
|
7 |
#include "engine_interface.h" |
8354b390f1a2
Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
14164
diff
changeset
|
8 |
#include "game_config.h" |
14164 | 9 |
|
10 |
class QQmlEngine; |
|
11 |
class PreviewImageProvider; |
|
14319 | 12 |
class EngineInstance; |
14164 | 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(); |
|
14319 | 27 |
Q_INVOKABLE EngineInstance* runQuickGame(); |
14164 | 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 |