mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 11:31:49 +00:00
the final rename
This commit is contained in:
parent
f27a418dbe
commit
1627e21c1d
196 changed files with 836 additions and 815 deletions
40
src/items/ItemStack.hpp
Normal file
40
src/items/ItemStack.hpp
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
#ifndef ITEMS_ITEM_STACK_HPP_
|
||||
#define ITEMS_ITEM_STACK_HPP_
|
||||
|
||||
#include "../typedefs.hpp"
|
||||
#include "../constants.hpp"
|
||||
|
||||
class ContentIndices;
|
||||
|
||||
class ItemStack {
|
||||
itemid_t item;
|
||||
itemcount_t count;
|
||||
public:
|
||||
ItemStack();
|
||||
|
||||
ItemStack(itemid_t item, itemcount_t count);
|
||||
|
||||
void set(const ItemStack& item);
|
||||
void setCount(itemcount_t count);
|
||||
|
||||
bool accepts(const ItemStack& item) const;
|
||||
void move(ItemStack& item, const ContentIndices* indices);
|
||||
|
||||
inline void clear() {
|
||||
set(ItemStack(0, 0));
|
||||
}
|
||||
|
||||
inline bool isEmpty() const {
|
||||
return item == ITEM_EMPTY;
|
||||
}
|
||||
|
||||
inline itemid_t getItemId() const {
|
||||
return item;
|
||||
}
|
||||
|
||||
inline itemcount_t getCount() const {
|
||||
return count;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // ITEMS_ITEM_STACK_HPP_
|
||||
Loading…
Add table
Add a link
Reference in a new issue