Item.h 900 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #pragma once
  2. #include "ItemType.h"
  3. #include "Reader.h"
  4. class ItemType;
  5. class Item : public virtual Framework::ReferenceCounter
  6. {
  7. protected:
  8. const ItemType* zType;
  9. float damage;
  10. float maxDamage;
  11. float durability;
  12. float maxDurability;
  13. bool eatable;
  14. bool placeable;
  15. bool equippable;
  16. bool solid;
  17. bool usable;
  18. int maxStackSize;
  19. Framework::Text name;
  20. Item( const ItemType* zType, const char* name );
  21. public:
  22. const ItemType* zItemType() const;
  23. float getDamage() const;
  24. float getDurability() const;
  25. bool isUsable() const;
  26. bool isEatable() const;
  27. bool isPlaceable() const;
  28. bool isEquippable() const;
  29. bool isSolid() const;
  30. float getMaxDurability() const;
  31. int getMaxStackSize() const;
  32. float getMaxDamage() const;
  33. const char* getName() const;
  34. friend ItemType;
  35. };