#pragma once #include "ItemType.h" class BasicItemType : public ItemType { private: Framework::Text itemName; float hp; float durability; bool solid; float hungerRecoveryPerHp; float thirstRecoveryPerHp; public: BasicItemType(); Item* createItem() const override; void setItemName(Framework::Text itemName); Framework::Text getItemName() const; void setHp(float hp); float getHp() const; void setDurability(float durability); float getDurability() const; void setSolid(bool solid); bool isSolid() const; void setHungerRecoveryPerHp(float hungerRecoveryPerHp); float getHungerRecoveryPerHp() const; void setThirstRecoveryPerHp(float thirstRecoveryPerHp); float getThirstRecoveryPerHp() const; }; class BasicItemTypeFactory : public ItemTypeFactoryBase { public: BasicItemTypeFactory(); BasicItemType* createValue( Framework::JSON::JSONObject* zJson) const override; void fromJson(BasicItemType* zResult, Framework::JSON::JSONObject* zJson) const override; void toJson(BasicItemType* zObject, Framework::JSON::JSONObject* zResult) const override; JSONObjectValidationBuilder* addToValidator( JSONObjectValidationBuilder* builder) const override; Framework::Text getTypeToken() const override; };