62 lines
1.5 KiB
C++
62 lines
1.5 KiB
C++
#ifndef QUESTSCENE_H
|
|
#define QUESTSCENE_H
|
|
|
|
#include <memory>
|
|
#include <QGraphicsScene>
|
|
#include <QGraphicsSceneMouseEvent>
|
|
#include <QGraphicsEffect>
|
|
#include <QLinkedList>
|
|
|
|
#include "models/qw_location.h"
|
|
#include "controls/qw_abstractscenecontrol.h"
|
|
|
|
/* QWScene
|
|
* The game scene itself. */
|
|
|
|
enum class MouseButton { LEFT, RIGHT };
|
|
|
|
class QWDialogueFrame;
|
|
|
|
class QWScene final : public QGraphicsScene
|
|
{
|
|
Q_OBJECT
|
|
Q_DISABLE_COPY_MOVE(QWScene)
|
|
private:
|
|
std::shared_ptr<QWLocation> location;
|
|
QLinkedList<std::shared_ptr<QWAbstractSceneControl>> list_on_inventory_widgets;
|
|
|
|
enum SceneStatus { GAMEPLAY, INVENTORY, MENU, DIALOGUE, EXAMINATION };
|
|
SceneStatus status;
|
|
|
|
protected:
|
|
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
|
|
void keyReleaseEvent(QKeyEvent *event) override;
|
|
|
|
public:
|
|
explicit QWScene(int x, int y);
|
|
|
|
QLinkedList<std::shared_ptr<QWAbstractSceneControl>> inventoryWidgets() const noexcept;
|
|
|
|
void setCurrentLocation(const std::shared_ptr<QWLocation> &loc) noexcept;
|
|
std::shared_ptr<QWLocation> currentLocation() const noexcept;
|
|
void clearLocation();
|
|
|
|
void onEndLevel(const QString &str) noexcept;
|
|
|
|
signals:
|
|
void signalClickInventory();
|
|
void signalClickDialogue(MouseButton);
|
|
void signalEnterMenu();
|
|
void signalLeaveMenu();
|
|
void signalEnterExamination();
|
|
void signalLeaveExamination();
|
|
|
|
public slots:
|
|
void onEntryGameplay() noexcept;
|
|
void onEntryInventory() noexcept;
|
|
void onEntryMenu() noexcept;
|
|
void onEntryDialogue() noexcept;
|
|
};
|
|
|
|
#endif // QUESTSCENE_H
|