#ifndef SYSTEMITEM_H
#define SYSTEMITEM_H

#include "item.h"

class SystemItem : public Item
{
	Q_OBJECT
private:
	QString onCommand_;
	QString offCommand_;

protected:
	virtual void enactValue(uint8_t value) override;

public:
	SystemItem(uint32_t itemIdIn = QRandomGenerator::global()->generate(), QString name = "Item", uint8_t value = 0,
	           QObject *parent = nullptr);
	SystemItem(const ItemData& itemData,  QObject *parent = nullptr);
	~SystemItem() = default;

	void setOnCommand(const QString& in);
	void setOffCommand(const QString& in);
	QString getOnCommand()
	{
		return onCommand_;
	}
	QString getOffCommand()
	{
		return offCommand_;
	}

	virtual void store(QJsonObject& json) override;
	virtual void load(const QJsonObject& json, const bool preserve = false) override;
};

#endif // SYSTEMITEM_H
