Browse Source

ItemStack ctor stuff

opengl-renderer-broken
Martin Dørum 4 years ago
parent
commit
c90512a9c9
1 changed files with 3 additions and 1 deletions
  1. 3
    1
      libswan/include/swan/ItemStack.h

+ 3
- 1
libswan/include/swan/ItemStack.h View File

@@ -6,7 +6,7 @@ class Item;

class ItemStack {
public:
ItemStack(Item *item, int count = 0): item_(item), count_(count) {
ItemStack(Item *item, int count): item_(item), count_(count) {

// We don't want a "partially empty" state.
if (item == nullptr || count == 0) {
@@ -15,6 +15,8 @@ public:
}
}

ItemStack(): item_(nullptr), count_(0) {}

Item *item() { return item_; }
int count() { return count_; }
bool empty() { return item_ == nullptr; }

Loading…
Cancel
Save