equal
deleted
inserted
replaced
8 #include "engine_interface.h" |
8 #include "engine_interface.h" |
9 #include "game_config.h" |
9 #include "game_config.h" |
10 |
10 |
11 class EngineInstance : public QObject { |
11 class EngineInstance : public QObject { |
12 Q_OBJECT |
12 Q_OBJECT |
|
13 |
13 public: |
14 public: |
|
15 using SimpleEventType = Engine::SimpleEventType; |
|
16 Q_ENUMS(SimpleEventType) |
|
17 using LongEventType = Engine::LongEventType; |
|
18 Q_ENUMS(LongEventType) |
|
19 using LongEventState = Engine::LongEventState; |
|
20 Q_ENUMS(LongEventState) |
|
21 using PositionedEventType = Engine::PositionedEventType; |
|
22 Q_ENUMS(PositionedEventType) |
|
23 |
14 explicit EngineInstance(const QString& libraryPath, |
24 explicit EngineInstance(const QString& libraryPath, |
15 QObject* parent = nullptr); |
25 QObject* parent = nullptr); |
16 ~EngineInstance(); |
26 ~EngineInstance(); |
17 |
27 |
18 Q_PROPERTY(bool isValid READ isValid NOTIFY isValidChanged) |
28 Q_PROPERTY(bool isValid READ isValid NOTIFY isValidChanged) |
28 void isValidChanged(bool isValid); |
38 void isValidChanged(bool isValid); |
29 |
39 |
30 public slots: |
40 public slots: |
31 void advance(quint32 ticks); |
41 void advance(quint32 ticks); |
32 void moveCamera(const QPoint& delta); |
42 void moveCamera(const QPoint& delta); |
33 void controlEvent(bool isStart, int type); |
43 void simpleEvent(SimpleEventType event_type); |
|
44 void longEvent(LongEventType event_type, LongEventState state); |
|
45 void positionedEvent(PositionedEventType event_type, qint32 x, qint32 y); |
34 |
46 |
35 private: |
47 private: |
36 Engine::EngineInstance* m_instance; |
48 Engine::EngineInstance* m_instance; |
37 |
49 |
38 Engine::hedgewars_engine_protocol_version_t* |
50 Engine::hedgewars_engine_protocol_version_t* |
45 Engine::read_ipc_t* read_ipc; |
57 Engine::read_ipc_t* read_ipc; |
46 Engine::setup_current_gl_context_t* setup_current_gl_context; |
58 Engine::setup_current_gl_context_t* setup_current_gl_context; |
47 Engine::render_frame_t* render_frame; |
59 Engine::render_frame_t* render_frame; |
48 Engine::advance_simulation_t* advance_simulation; |
60 Engine::advance_simulation_t* advance_simulation; |
49 Engine::move_camera_t* move_camera; |
61 Engine::move_camera_t* move_camera; |
|
62 Engine::simple_event_t* simple_event; |
|
63 Engine::long_event_t* long_event; |
|
64 Engine::positioned_event_t* positioned_event; |
50 bool m_isValid; |
65 bool m_isValid; |
51 }; |
66 }; |
52 |
67 |
|
68 Q_DECLARE_METATYPE(EngineInstance::SimpleEventType) |
|
69 Q_DECLARE_METATYPE(EngineInstance::LongEventType) |
|
70 Q_DECLARE_METATYPE(EngineInstance::LongEventState) |
|
71 Q_DECLARE_METATYPE(EngineInstance::PositionedEventType) |
|
72 |
53 #endif // ENGINEINSTANCE_H |
73 #endif // ENGINEINSTANCE_H |