qmlfrontend/hwengine.h
author unc0rr
Sun, 02 Dec 2018 00:19:17 +0100
changeset 14380 5e28098fb593
parent 14319 00b56ec8b7df
child 14392 90bd2c331703
permissions -rw-r--r--
Fix stray tab character

#ifndef HWENGINE_H
#define HWENGINE_H

#include <QList>
#include <QObject>

#include "engine_interface.h"
#include "game_config.h"

class QQmlEngine;
class PreviewImageProvider;
class EngineInstance;

class HWEngine : public QObject {
  Q_OBJECT

  Q_PROPERTY(int previewHedgehogsCount READ previewHedgehogsCount NOTIFY
                 previewHedgehogsCountChanged)

 public:
  explicit HWEngine(QQmlEngine* engine, QObject* parent = nullptr);
  ~HWEngine();

  static void exposeToQML();

  Q_INVOKABLE void getPreview();
  Q_INVOKABLE EngineInstance* runQuickGame();

  int previewHedgehogsCount() const;

 signals:
  void previewIsRendering();
  void previewImageChanged();
  void previewHogCountChanged(int count);
  void gameFinished();
  void previewHedgehogsCountChanged(int previewHedgehogsCount);

 private:
  QQmlEngine* m_engine;
  PreviewImageProvider* m_previewProvider;
  GameConfig m_gameConfig;
  int m_previewHedgehogsCount;
};

#endif  // HWENGINE_H