qmlfrontend/hwengine.h
author Wuzzy <Wuzzy2@mail.ru>
Mon, 19 Nov 2018 18:27:45 +0100
changeset 14241 bf627790da14
parent 14154 8354b390f1a2
child 14273 645e4591361f
permissions -rw-r--r--
Show extra seconds when collecting a crate in Teamwork String freeze is not violated because the string was already collected.

#ifndef HWENGINE_H
#define HWENGINE_H

#include <QList>
#include <QObject>

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

class QQmlEngine;
class PreviewImageProvider;

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 void 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;
  QByteArray m_seed;
  int m_previewHedgehogsCount;
};

#endif  // HWENGINE_H