author | unC0Rr |
Fri, 07 Dec 2018 13:35:08 +0100 | |
changeset 14376 | 90bd2c331703 |
parent 14303 | 00b56ec8b7df |
child 14377 | b6824a53d4b1 |
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; |
|
14303 | 11 |
class EngineInstance; |
14376
90bd2c331703
Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
14303
diff
changeset
|
12 |
class PreviewAcceptor; |
14148 | 13 |
|
14 |
class HWEngine : public QObject { |
|
15 |
Q_OBJECT |
|
16 |
||
17 |
Q_PROPERTY(int previewHedgehogsCount READ previewHedgehogsCount NOTIFY |
|
18 |
previewHedgehogsCountChanged) |
|
14376
90bd2c331703
Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
14303
diff
changeset
|
19 |
Q_PROPERTY(PreviewAcceptor* previewAcceptor READ previewAcceptor WRITE |
90bd2c331703
Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
14303
diff
changeset
|
20 |
setPreviewAcceptor NOTIFY previewAcceptorChanged) |
14148 | 21 |
|
22 |
public: |
|
14376
90bd2c331703
Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
14303
diff
changeset
|
23 |
explicit HWEngine(QObject* parent = nullptr); |
14148 | 24 |
~HWEngine(); |
25 |
||
26 |
Q_INVOKABLE void getPreview(); |
|
14303 | 27 |
Q_INVOKABLE EngineInstance* runQuickGame(); |
14148 | 28 |
|
29 |
int previewHedgehogsCount() const; |
|
14376
90bd2c331703
Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
14303
diff
changeset
|
30 |
PreviewAcceptor* previewAcceptor() const; |
90bd2c331703
Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
14303
diff
changeset
|
31 |
|
90bd2c331703
Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
14303
diff
changeset
|
32 |
public slots: |
90bd2c331703
Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
14303
diff
changeset
|
33 |
void setPreviewAcceptor(PreviewAcceptor* previewAcceptor); |
14148 | 34 |
|
35 |
signals: |
|
36 |
void previewIsRendering(); |
|
37 |
void previewImageChanged(); |
|
38 |
void previewHogCountChanged(int count); |
|
39 |
void gameFinished(); |
|
40 |
void previewHedgehogsCountChanged(int previewHedgehogsCount); |
|
14376
90bd2c331703
Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
14303
diff
changeset
|
41 |
void previewAcceptorChanged(PreviewAcceptor* previewAcceptor); |
14148 | 42 |
|
43 |
private: |
|
44 |
QQmlEngine* m_engine; |
|
45 |
GameConfig m_gameConfig; |
|
46 |
int m_previewHedgehogsCount; |
|
14376
90bd2c331703
Add possibility to instantiate HWEngine objects from QML, reorganize work with preview
unC0Rr
parents:
14303
diff
changeset
|
47 |
PreviewAcceptor* m_previewAcceptor; |
14148 | 48 |
}; |
49 |
||
50 |
#endif // HWENGINE_H |