hotseatgame.h 939 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #ifndef HOTSEATGAME_H
  2. #define HOTSEATGAME_H
  3. #include <QWidget>
  4. #include "gui/scene.h"
  5. #include "hotseatgame/gamemanager.h"
  6. #include "hotseatgame/gameproperties.h"
  7. namespace Ui {
  8. class HotSeatGame;
  9. }
  10. class HotSeatGame;
  11. class DrawSceneEventListener : public QObject
  12. {
  13. Q_OBJECT
  14. public:
  15. DrawSceneEventListener(HotSeatGame* scene, QObject *parent = nullptr);
  16. virtual bool eventFilter(QObject * watched, QEvent * event) Q_DECL_OVERRIDE;
  17. signals:
  18. public slots:
  19. private:
  20. HotSeatGame* scene_;
  21. };
  22. class HotSeatGame : public Scene
  23. {
  24. Q_OBJECT
  25. public:
  26. explicit HotSeatGame(QWidget *parent = 0);
  27. ~HotSeatGame();
  28. void init() override;
  29. void deinit() override;
  30. private slots:
  31. void on_surrender_button__clicked();
  32. void drawField();
  33. private:
  34. void paintField();
  35. QGraphicsScene *game_scene_;
  36. Ui::HotSeatGame *ui;
  37. DrawSceneEventListener *game_scene_watcher_;
  38. };
  39. #endif // HOTSEATGAME_H