diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-10-11 23:17:58 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-10-11 23:17:58 +0300 |
commit | 4dbda55f670866db29a64ca7a79500efbe6f8d00 (patch) | |
tree | ddf806b499dcb4896568278b05defad1f27bcd06 /src/inventory.cpp | |
parent | fbb1186a319794dba7c23c466c07d6f45f940b8e (diff) | |
download | manaverse-4dbda55f670866db29a64ca7a79500efbe6f8d00.tar.gz manaverse-4dbda55f670866db29a64ca7a79500efbe6f8d00.tar.bz2 manaverse-4dbda55f670866db29a64ca7a79500efbe6f8d00.tar.xz manaverse-4dbda55f670866db29a64ca7a79500efbe6f8d00.zip |
Replace some getters to direct fileds using.
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r-- | src/inventory.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/inventory.cpp b/src/inventory.cpp index 1ad983956..3a87ce8ea 100644 --- a/src/inventory.cpp +++ b/src/inventory.cpp @@ -42,7 +42,7 @@ struct SlotUsed final : public std::unary_function<Item*, bool> { bool operator()(const Item *const item) const { - return item && item->getId() >= 0 && item->getQuantity() > 0; + return item && item->mId >= 0 && item->mQuantity > 0; } }; @@ -69,7 +69,7 @@ Inventory::~Inventory() Item *Inventory::getItem(const int index) const { if (index < 0 || index >= static_cast<int>(mSize) || !mItems[index] - || mItems[index]->getQuantity() <= 0) + || mItems[index]->mQuantity <= 0) { return nullptr; } @@ -81,10 +81,10 @@ Item *Inventory::findItem(const int itemId, const unsigned char color) const { for (unsigned i = 0; i < mSize; i++) { - if (mItems[i] && mItems[i]->getId() == itemId) + if (mItems[i] && mItems[i]->mId == itemId) { - if (color == 0 || mItems[i]->getColor() == color - || (color == 1 && mItems[i]->getColor() <= 1)) + if (color == 0 || mItems[i]->mColor == color + || (color == 1 && mItems[i]->mColor <= 1)) { return mItems[i]; } @@ -141,7 +141,7 @@ void Inventory::removeItem(const int id) { for (unsigned i = 0; i < mSize; i++) { - if (mItems[i] && mItems[i]->getId() == id) + if (mItems[i] && mItems[i]->mId == id) removeItemAt(i); } } @@ -164,7 +164,7 @@ bool Inventory::contains(const Item *const item) const for (unsigned i = 0; i < mSize; i++) { - if (mItems[i] && mItems[i]->getId() == item->getId()) + if (mItems[i] && mItems[i]->mId == item->mId) return true; } |