ItemStack.h 581 B

123456789101112131415161718192021222324252627
  1. #pragma once
  2. #include "Item.h"
  3. class ItemStack : public virtual Framework::ReferenceCounter
  4. {
  5. private:
  6. Item* item;
  7. int size;
  8. int maxSize;
  9. public:
  10. ItemStack(Item* item, int currentSize, int maxSize);
  11. ItemStack(Item* item, int currentSize);
  12. ~ItemStack();
  13. void setMaxSize(int size);
  14. ItemStack* split(int size);
  15. Item* extractFromStack();
  16. bool addToStack(Item* item);
  17. void addItemStack(ItemStack* zItemStack);
  18. bool isStackable(Item* zItem) const;
  19. const Item* zItem() const;
  20. int getSize() const;
  21. int getMaxSize() const;
  22. };