mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
format: reformat project
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
This commit is contained in:
parent
736cd175d5
commit
bbf33e8e4d
202 changed files with 7389 additions and 5609 deletions
|
|
@ -1,12 +1,13 @@
|
|||
#include "ItemStack.hpp"
|
||||
|
||||
#include "ItemDef.hpp"
|
||||
#include "../content/Content.hpp"
|
||||
#include "ItemDef.hpp"
|
||||
|
||||
ItemStack::ItemStack() : item(ITEM_EMPTY), count(0) {
|
||||
}
|
||||
|
||||
ItemStack::ItemStack(itemid_t item, itemcount_t count) : item(item), count(count) {
|
||||
ItemStack::ItemStack(itemid_t item, itemcount_t count)
|
||||
: item(item), count(count) {
|
||||
}
|
||||
|
||||
void ItemStack::set(const ItemStack& item) {
|
||||
|
|
@ -26,13 +27,13 @@ bool ItemStack::accepts(const ItemStack& other) const {
|
|||
|
||||
void ItemStack::move(ItemStack& item, const ContentIndices* indices) {
|
||||
auto def = indices->items.get(item.getItemId());
|
||||
int count = std::min(item.count, def->stackSize-this->count);
|
||||
int count = std::min(item.count, def->stackSize - this->count);
|
||||
if (isEmpty()) {
|
||||
set(ItemStack(item.getItemId(), count));
|
||||
} else {
|
||||
setCount(this->count + count);
|
||||
}
|
||||
item.setCount(item.count-count);
|
||||
item.setCount(item.count - count);
|
||||
}
|
||||
|
||||
void ItemStack::setCount(itemcount_t count) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue