move from tabs to spaces
This commit is contained in:
parent
a6aad07f05
commit
fa45072998
86 changed files with 2611 additions and 2486 deletions
|
|
@ -11,67 +11,74 @@ class Actor;
|
|||
class ItemData
|
||||
{
|
||||
protected:
|
||||
QString name_;
|
||||
uint8_t value_;
|
||||
uint32_t itemId_;
|
||||
QString name_;
|
||||
uint8_t value_;
|
||||
uint32_t itemId_;
|
||||
|
||||
public:
|
||||
|
||||
ItemData(uint32_t itemIdIn = QRandomGenerator::global()->generate(), QString name = "Item", uint8_t value = 0);
|
||||
ItemData(uint32_t itemIdIn = QRandomGenerator::global()->generate(), QString name = "Item", uint8_t value = 0);
|
||||
|
||||
inline bool operator==(const ItemData& in) const{ return itemId_==in.itemId_; }
|
||||
inline bool operator!=(const ItemData& in) const{ return itemId_!=in.itemId_; }
|
||||
inline bool operator==(const ItemData& in) const
|
||||
{
|
||||
return itemId_==in.itemId_;
|
||||
}
|
||||
inline bool operator!=(const ItemData& in) const
|
||||
{
|
||||
return itemId_!=in.itemId_;
|
||||
}
|
||||
|
||||
uint32_t id() const;
|
||||
uint32_t id() const;
|
||||
|
||||
void setName(QString name);
|
||||
uint8_t getValue() const;
|
||||
virtual QString getName() const;
|
||||
void setName(QString name);
|
||||
uint8_t getValue() const;
|
||||
virtual QString getName() const;
|
||||
};
|
||||
|
||||
|
||||
class Item: public QObject, public ItemData
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
private:
|
||||
std::vector< std::shared_ptr<Actor> > actors_;
|
||||
std::vector< std::shared_ptr<Actor> > actors_;
|
||||
|
||||
bool override_ = false;
|
||||
bool override_ = false;
|
||||
|
||||
public:
|
||||
|
||||
static bool secondaryFlag;
|
||||
static bool secondaryFlag;
|
||||
|
||||
signals:
|
||||
|
||||
void valueChanged(uint8_t value);
|
||||
void valueChanged(uint8_t value);
|
||||
|
||||
private slots:
|
||||
virtual void actorSetValue(uint8_t value);
|
||||
virtual void actorSetValue(uint8_t value);
|
||||
|
||||
public slots:
|
||||
|
||||
virtual void setValue(uint8_t value);
|
||||
virtual void setValue(uint8_t value);
|
||||
|
||||
public:
|
||||
|
||||
Item(uint32_t itemIdIn = QRandomGenerator::global()->generate(), QString name = "Item", uint8_t value = 0, QObject *parent = nullptr);
|
||||
Item(const ItemData& itemData, QObject *parent = nullptr);
|
||||
Item(uint32_t itemIdIn = QRandomGenerator::global()->generate(), QString name = "Item", uint8_t value = 0,
|
||||
QObject *parent = nullptr);
|
||||
Item(const ItemData& itemData, QObject *parent = nullptr);
|
||||
|
||||
virtual ~Item();
|
||||
virtual ~Item();
|
||||
|
||||
std::vector< std::shared_ptr<Actor> >& getActors();
|
||||
bool hasActors();
|
||||
void addActor(std::shared_ptr<Actor> actor);
|
||||
bool removeActor(std::shared_ptr<Actor> actor);
|
||||
void removeAllActors();
|
||||
void setActorsActive(bool in);
|
||||
void setOverride(const bool in);
|
||||
bool getOverride();
|
||||
void informValue(uint8_t value);
|
||||
std::vector< std::shared_ptr<Actor> >& getActors();
|
||||
bool hasActors();
|
||||
void addActor(std::shared_ptr<Actor> actor);
|
||||
bool removeActor(std::shared_ptr<Actor> actor);
|
||||
void removeAllActors();
|
||||
void setActorsActive(bool in);
|
||||
void setOverride(const bool in);
|
||||
bool getOverride();
|
||||
void informValue(uint8_t value);
|
||||
|
||||
virtual void store(QJsonObject& json);
|
||||
virtual void load(const QJsonObject& json, const bool preserve = false);
|
||||
virtual void store(QJsonObject& json);
|
||||
virtual void load(const QJsonObject& json, const bool preserve = false);
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue