32 lines
768 B
C
32 lines
768 B
C
|
#ifndef QWADDTRIGGER_H
|
||
|
#define QWADDTRIGGER_H
|
||
|
|
||
|
#include "qw_abstractsceneevent.h"
|
||
|
|
||
|
/* QWAddTriggerEvent
|
||
|
* Adds a trigger to its location list. */
|
||
|
|
||
|
class QWAddTriggerEvent : public QWAbstractSceneEvent
|
||
|
{
|
||
|
private:
|
||
|
std::shared_ptr<QWTrigger> trigger; // What to add.
|
||
|
std::shared_ptr<QWLocation> location; // Where to add.
|
||
|
|
||
|
public:
|
||
|
explicit QWAddTriggerEvent(const std::shared_ptr<QWTrigger> &tr);
|
||
|
virtual ~QWAddTriggerEvent() override {}
|
||
|
|
||
|
void execute() override;
|
||
|
|
||
|
////////////////////////
|
||
|
|
||
|
void setLocation(const std::shared_ptr<QWLocation> &loc) noexcept;
|
||
|
void setTrigger(const std::shared_ptr<QWTrigger> &tr) noexcept;
|
||
|
|
||
|
////////////////////////
|
||
|
|
||
|
void writeToJson(QJsonObject &event_data) override;
|
||
|
};
|
||
|
|
||
|
#endif // QWADDTRIGGER_H
|