47 lines
1.3 KiB
C++
47 lines
1.3 KiB
C++
#ifndef TRIGGER_H
|
|
#define TRIGGER_H
|
|
|
|
#include <memory>
|
|
#include <QGraphicsPixmapItem>
|
|
#include "events/qw_abstractevent.h"
|
|
|
|
/* QWTrigger
|
|
* Represents an interactive in-game element. */
|
|
|
|
class QWStartDialogueEvent;
|
|
|
|
class QWTrigger : public QGraphicsPixmapItem, public QWTagHolder
|
|
{
|
|
private:
|
|
QList<std::shared_ptr<QWAbstractEvent>> list_events;
|
|
std::shared_ptr<QWAbstractEvent> examination_event;
|
|
QString pix_path;
|
|
|
|
public:
|
|
explicit QWTrigger(const QString &path);
|
|
|
|
void clearEvents() noexcept;
|
|
void setEvents(std::initializer_list<std::shared_ptr<QWAbstractEvent>> &&evs) noexcept;
|
|
void setEvents(const QList<std::shared_ptr<QWAbstractEvent>> &evs) noexcept;
|
|
void addEvents(std::initializer_list<std::shared_ptr<QWAbstractEvent>> &&evs) noexcept;
|
|
void addEvents(const std::shared_ptr<QWAbstractEvent> &ev) noexcept;
|
|
QList<std::shared_ptr<QWAbstractEvent>> events() const;
|
|
|
|
void setCover(qreal x, qreal y, const QString &path) noexcept;
|
|
void setCover(const QString &path) noexcept;
|
|
inline QString path() const noexcept;
|
|
|
|
void setExaminationDialogueEvent(const std::shared_ptr<QWAbstractEvent> &dialogue_event);
|
|
void startExaminationDialogue() const;
|
|
|
|
void activate() const;
|
|
|
|
////////////////////////
|
|
|
|
void writeToJson(QJsonObject &trigger_data) override;
|
|
};
|
|
|
|
|
|
|
|
#endif // TRIGGER_H
|