ItemSlot.h 879 B

1234567891011121314151617181920212223242526272829303132
  1. #pragma once
  2. #include "ItemStack.h"
  3. #include "Area.h"
  4. class ItemSlot : public virtual Framework::ReferenceCounter
  5. {
  6. private:
  7. ItemStack* items;
  8. int maxSize;
  9. Directions allowedPullSide;
  10. Directions allowedPushSides;
  11. int pullPriority;
  12. int pushPriority;
  13. bool allowHigherStackSize;
  14. public:
  15. ItemSlot( int maxSize, int pullPriority, int pushPriority, int allowedPullSide, int allowedPushSides, bool allowHigherStackSize );
  16. ~ItemSlot();
  17. ItemStack* takeItemsOut( int count, Direction dir );
  18. void addItems( ItemStack* zStack, Direction dir );
  19. int numberOfAddableItems( const ItemStack* zStack, Direction dir ) const;
  20. const ItemStack* zStack() const;
  21. int getPullPriority() const;
  22. int getPushPriority() const;
  23. bool isFull() const;
  24. int getFreeSpace() const;
  25. bool isEmpty() const;
  26. int getNumberOfItems() const;
  27. };