diff options
-rw-r--r-- | src/inventory.cpp | 14 | ||||
-rw-r--r-- | src/inventory.h | 4 |
2 files changed, 18 insertions, 0 deletions
diff --git a/src/inventory.cpp b/src/inventory.cpp index dfa201cdf..0a76dff7d 100644 --- a/src/inventory.cpp +++ b/src/inventory.cpp @@ -160,6 +160,20 @@ void Inventory::setItem(const int index, } } +void Inventory::setCards(const int index, + const int *const cards, + const int size) +{ + if (index < 0 || index >= static_cast<int>(mSize)) + { + logger->log("Warning: invalid inventory index: %d", index); + return; + } + + Item *const item1 = mItems[index]; + item1->setCards(cards, size); +} + void Inventory::clear() { for (unsigned i = 0; i < mSize; i++) diff --git a/src/inventory.h b/src/inventory.h index be0f0aca9..4c9417db4 100644 --- a/src/inventory.h +++ b/src/inventory.h @@ -111,6 +111,10 @@ class Inventory final const bool equipment, const bool equipped); + void setCards(const int index, + const int *const cards, + const int size); + /** * Remove a item from the inventory. */ |