diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-10-21 16:49:34 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-10-21 16:49:34 +0300 |
commit | c5e89f9543fcf7cb86d54e51356865e7001b6977 (patch) | |
tree | f0c7cfabdd05772b05070f56b3d2601ad43e5bb4 /src/inventory.cpp | |
parent | 26a4a4ddfde04ae02964c434063d74d82e3a2143 (diff) | |
download | ManaVerse-c5e89f9543fcf7cb86d54e51356865e7001b6977.tar.gz ManaVerse-c5e89f9543fcf7cb86d54e51356865e7001b6977.tar.bz2 ManaVerse-c5e89f9543fcf7cb86d54e51356865e7001b6977.tar.xz ManaVerse-c5e89f9543fcf7cb86d54e51356865e7001b6977.zip |
Add to inventory methods for cards.
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r-- | src/inventory.cpp | 14 |
1 files changed, 14 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++) |