author | GunChleoc |
Fri, 16 Nov 2018 20:41:38 +0100 | |
changeset 14236 | 5d46fa68c9d8 |
parent 14175 | 8354b390f1a2 |
child 14294 | 645e4591361f |
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; |
|
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 |