ItemSlot.cpp 807 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #include "ItemSlot.h"
  2. ItemSlot::ItemSlot( int maxSize, int pullPriority, int pushPriority, int allowedPullSide, int allowedPushSides, bool allowHigherStackSize )
  3. : ReferenceCounter(),
  4. items( 0 ),
  5. maxSize( maxSize ),
  6. allowedPullSide( allowedPullSide ),
  7. allowedPushSides( allowedPushSides ),
  8. pullPriority( pullPriority ),
  9. pushPriority( pushPriority ),
  10. allowHigherStackSize( allowHigherStackSize )
  11. {}
  12. ItemSlot::~ItemSlot()
  13. {
  14. if( items )
  15. items->release();
  16. }
  17. void ItemSlot::setItems( ItemStack* items )
  18. {
  19. this->items = items;
  20. }
  21. int ItemSlot::getPullPriority() const
  22. {
  23. return pullPriority;
  24. }
  25. int ItemSlot::getPushPriority() const
  26. {
  27. return pushPriority;
  28. }
  29. ItemStack* ItemSlot::zStack() const
  30. {
  31. return items;
  32. }