mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 19:41:51 +00:00
refactor
This commit is contained in:
parent
b1740bf7eb
commit
4306573320
7 changed files with 26 additions and 24 deletions
|
|
@ -6,10 +6,10 @@
|
|||
class ContentIndices;
|
||||
|
||||
class ItemStack {
|
||||
itemid_t item;
|
||||
itemcount_t count;
|
||||
itemid_t item = ITEM_EMPTY;
|
||||
itemcount_t count = 0;
|
||||
public:
|
||||
ItemStack();
|
||||
ItemStack() = default;
|
||||
|
||||
ItemStack(itemid_t item, itemcount_t count);
|
||||
|
||||
|
|
@ -17,7 +17,12 @@ public:
|
|||
void setCount(itemcount_t count);
|
||||
|
||||
bool accepts(const ItemStack& item) const;
|
||||
void move(ItemStack& item, const ContentIndices* indices);
|
||||
|
||||
/// @brief Move items from one stack to another.
|
||||
/// If the target stack is completely filled, the source stack will be reduced.
|
||||
/// @param item source stack
|
||||
/// @param indices content indices
|
||||
void move(ItemStack& item, const ContentIndices& indices);
|
||||
|
||||
inline void clear() {
|
||||
set(ItemStack(0, 0));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue