1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- #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(Framework::Text name,
- ModelInfo* model,
- Framework::Text itemName,
- float hp,
- float durability,
- int maxStack,
- bool solid,
- float hungerRecoveryPerHp,
- float thirstRecoveryPerHp);
- Item* createItem() const override;
- Framework::Text getItemName() const;
- float getHp() const;
- float getDurability() const;
- bool isSolid() const;
- float getHungerRecoveryPerHp() const;
- float getThirstRecoveryPerHp() const;
- };
- class BasicItemTypeFactory : public SubTypeFactory<ItemType, BasicItemType>
- {
- public:
- BasicItemTypeFactory();
- BasicItemType* fromJson(Framework::JSON::JSONObject* zJson) const override;
- Framework::JSON::JSONObject* toJson(BasicItemType* zObject) const override;
- Framework::JSON::Validator::JSONValidator* getValidator(
- Framework::JSON::Validator::ObjectValidationBuilder<
- Framework::JSON::Validator::JSONValidator>* builder) const override;
- Framework::Text getTypeToken() const override;
- };
|