1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- #pragma once
- #include "ItemType.h"
- #include "Reader.h"
- class ItemType;
- class BlockType;
- class StoneToolItemType;
- class Item : public virtual Framework::ReferenceCounter
- {
- protected:
- const ItemType* zType;
- const BlockType* zBlockType;
- float damage;
- float maxDamage;
- float durability;
- float maxDurability;
- bool eatable;
- bool placeable;
- bool equippable;
- bool solid;
- bool usable;
- int maxStackSize;
- Framework::Text name;
- Item(const ItemType* zType, const char* name);
- public:
- virtual void tick();
- const ItemType* zItemType() const;
- const BlockType* zPlacedBlockType() const;
- float getDamage() const;
- float getDurability() const;
- bool isUsable() const;
- bool isEatable() const;
- bool isPlaceable() const;
- bool isEquippable() const;
- bool isSolid() const;
- float getMaxDurability() const;
- int getMaxStackSize() const;
- float getMaxDamage() const;
- virtual bool canBeStackedWith(const Item* zItem) const;
- virtual void onPlaced();
- virtual void applyInventoryEffects(Entity* zTarget);
- virtual void removeInventoryEffects(Entity* zTarget);
- virtual void applyEquippedEffects(Entity* zTarget);
- virtual void removeEquippedEffects(Entity* zTarget);
- virtual void applyFoodEffects(Entity* zTarget);
- friend ItemType;
- };
|