ItemStack.cpp 588 B

1234567891011121314151617181920212223242526272829303132333435
  1. #include "ItemStack.h"
  2. #include "Item.h"
  3. ItemStack::ItemStack( Item* item, int currentSize, int maxSize )
  4. : ReferenceCounter(),
  5. item( item ),
  6. size( currentSize ),
  7. maxSize( maxSize )
  8. {}
  9. ItemStack::ItemStack( Item* item, int currentSize )
  10. : ItemStack( item, currentSize, item->getMaxStackSize() )
  11. {}
  12. ItemStack::~ItemStack()
  13. {
  14. if( item )
  15. item->release();
  16. }
  17. int ItemStack::getSize() const
  18. {
  19. return size;
  20. }
  21. int ItemStack::getMaxSize() const
  22. {
  23. return maxSize;
  24. }
  25. Item* ItemStack::zItem() const
  26. {
  27. return item;
  28. }