52 lines
1.4 KiB
C++
52 lines
1.4 KiB
C++
#ifndef QWLOCATION_H
|
|
#define QWLOCATION_H
|
|
|
|
#include <memory>
|
|
#include <QList>
|
|
|
|
#include "events/qw_abstractevent.h"
|
|
|
|
/* QWLocation
|
|
* Represents any game location. */
|
|
|
|
class QWTrigger;
|
|
|
|
class QWLocation final : public QWTagHolder
|
|
{
|
|
private:
|
|
QList<std::shared_ptr<QWTrigger>> list_triggers;
|
|
std::shared_ptr<QWTrigger> first_visit_trigger;
|
|
bool flag_discovered;
|
|
|
|
QString music_path;
|
|
|
|
public:
|
|
explicit QWLocation();
|
|
|
|
void clearTriggers() noexcept;
|
|
void setTriggers(std::initializer_list<std::shared_ptr<QWTrigger>> &&trs) noexcept;
|
|
void setTriggers(const QList<std::shared_ptr<QWTrigger>> &trs) noexcept;
|
|
void addTriggers(std::initializer_list<std::shared_ptr<QWTrigger>> &&trs) noexcept;
|
|
void addTriggers(const std::shared_ptr<QWTrigger> &tr) noexcept;
|
|
void removeTrigger(const std::shared_ptr<QWTrigger> &tr) noexcept;
|
|
QList<std::shared_ptr<QWTrigger>> triggers() const;
|
|
|
|
// Should be activated on first visit.
|
|
void setFirstVisitTrigger(const std::shared_ptr<QWTrigger> &tr) noexcept;
|
|
std::shared_ptr<QWTrigger> firstVisitTrigger() const noexcept;
|
|
|
|
void setDiscovered(bool discovered) noexcept;
|
|
bool discovered() const noexcept;
|
|
|
|
void setMusicPath(const QString &path) noexcept;
|
|
void removeMusic() noexcept;
|
|
QString musicPath() const noexcept;
|
|
|
|
|
|
////////////////////////
|
|
|
|
void writeToJson(QJsonObject &location_data) override;
|
|
};
|
|
|
|
#endif // QWLOCATION_H
|