#ifndef QUESTACTIVATEITEMEVENT_H #define QUESTACTIVATEITEMEVENT_H #include #include #include "qw_abstractevent.h" /* QWSwitchEventsEvent * Changes events of its linked QWTrigger. * For example: a door is being closed until we pick up a key. * It's initial state "to print message "go find a key you punk". * When we activate its key, execute() changes door event to "go through". */ class QWTrigger; class QWSwitchEventsEvent : public QWAbstractEvent { private: std::shared_ptr ptr_target; bool b_active; QList> list_disabled_events; QList> list_enabled_events; public: explicit QWSwitchEventsEvent(const std::shared_ptr &tr); virtual ~QWSwitchEventsEvent() override {} void execute() override; //////////////////////// void setTarget(const std::shared_ptr &tr) noexcept; std::shared_ptr target() const noexcept; void setEventsOnDisable(const QList> &evs) noexcept; void setEventsOnEnable(const QList> &evs) noexcept; // init() sets an inital state of ptr_trigger. void init(); //////////////////////// void writeToJson(QJsonObject &event_data) override; }; #endif // QUESTACTIVATEITEMEVENT_H