qmlfrontend/hwengine.cpp
changeset 14319 00b56ec8b7df
parent 14315 21be7838a127
child 14392 90bd2c331703
--- a/qmlfrontend/hwengine.cpp	Mon Nov 26 14:31:36 2018 +0100
+++ b/qmlfrontend/hwengine.cpp	Mon Nov 26 14:48:38 2018 +0100
@@ -32,6 +32,9 @@
   qmlRegisterSingletonType<HWEngine>("Hedgewars.Engine", 1, 0, "HWEngine",
                                      hwengine_singletontype_provider);
   qmlRegisterType<GameView>("Hedgewars.Engine", 1, 0, "GameView");
+  qmlRegisterUncreatableType<EngineInstance>("Hedgewars.Engine", 1, 0,
+                                             "EngineInstance",
+                                             "Create by HWEngine run methods");
 }
 
 void HWEngine::getPreview() {
@@ -61,7 +64,7 @@
   // m_runQueue->queue(m_gameConfig);
 }
 
-void HWEngine::runQuickGame() {
+EngineInstance* HWEngine::runQuickGame() {
   m_gameConfig.cmdTheme("Nature");
   Team team1;
   team1.name = "team1";
@@ -71,6 +74,8 @@
   m_gameConfig.cmdTeam(team1);
   m_gameConfig.cmdTeam(team2);
 
+  EngineInstance* engine = new EngineInstance(this);
+  return engine;
   // m_runQueue->queue(m_gameConfig);
 }