From c5e89f9543fcf7cb86d54e51356865e7001b6977 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 21 Oct 2014 16:49:34 +0300 Subject: Add to inventory methods for cards. --- src/inventory.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/inventory.cpp') 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(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++) -- cgit v1.2.3-60-g2f50