summaryrefslogtreecommitdiff
path: root/src/net/eathena
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-04-03 00:01:34 +0300
committerAndrei Karas <akaras@inbox.ru>2013-04-03 00:01:34 +0300
commit1eea3f1102b7d8f87b076a5a8380fd71fc00d773 (patch)
treec6c993c12631ff2e9f9d9784e83497caf87edbf6 /src/net/eathena
parent2f6f5950605e3ffe8054f3a2675f10032ca0aaf6 (diff)
downloadmanaverse-1eea3f1102b7d8f87b076a5a8380fd71fc00d773.tar.gz
manaverse-1eea3f1102b7d8f87b076a5a8380fd71fc00d773.tar.bz2
manaverse-1eea3f1102b7d8f87b076a5a8380fd71fc00d773.tar.xz
manaverse-1eea3f1102b7d8f87b076a5a8380fd71fc00d773.zip
improve inventoryhandler class.
Diffstat (limited to 'src/net/eathena')
-rw-r--r--src/net/eathena/inventoryhandler.cpp14
-rw-r--r--src/net/eathena/inventoryhandler.h15
2 files changed, 15 insertions, 14 deletions
diff --git a/src/net/eathena/inventoryhandler.cpp b/src/net/eathena/inventoryhandler.cpp
index 80b8ed73c..79219cb42 100644
--- a/src/net/eathena/inventoryhandler.cpp
+++ b/src/net/eathena/inventoryhandler.cpp
@@ -135,7 +135,7 @@ void InventoryHandler::handleMessage(Net::MessageIn &msg)
}
}
-void InventoryHandler::equipItem(const Item *item)
+void InventoryHandler::equipItem(const Item *const item) const
{
if (!item)
return;
@@ -146,7 +146,7 @@ void InventoryHandler::equipItem(const Item *item)
outMsg.writeInt16(0);
}
-void InventoryHandler::unequipItem(const Item *item)
+void InventoryHandler::unequipItem(const Item *const item) const
{
if (!item)
return;
@@ -156,7 +156,7 @@ void InventoryHandler::unequipItem(const Item *item)
item->getInvIndex() + INVENTORY_OFFSET));
}
-void InventoryHandler::useItem(const Item *item)
+void InventoryHandler::useItem(const Item *const item) const
{
if (!item)
return;
@@ -167,7 +167,7 @@ void InventoryHandler::useItem(const Item *item)
outMsg.writeInt32(item->getId()); // unused
}
-void InventoryHandler::dropItem(const Item *item, int amount)
+void InventoryHandler::dropItem(const Item *const item, const int amount) const
{
if (!item)
return;
@@ -179,13 +179,13 @@ void InventoryHandler::dropItem(const Item *item, int amount)
outMsg.writeInt16(static_cast<int16_t>(amount));
}
-void InventoryHandler::closeStorage(int type A_UNUSED)
+void InventoryHandler::closeStorage(const int type A_UNUSED) const
{
MessageOut outMsg(CMSG_CLOSE_STORAGE);
}
-void InventoryHandler::moveItem2(int source, int slot, int amount,
- int destination)
+void InventoryHandler::moveItem2(const int source, const int slot,
+ const int amount, const int destination) const
{
if (source == Inventory::INVENTORY && destination == Inventory::STORAGE)
{
diff --git a/src/net/eathena/inventoryhandler.h b/src/net/eathena/inventoryhandler.h
index 77f128838..f6e87fd2a 100644
--- a/src/net/eathena/inventoryhandler.h
+++ b/src/net/eathena/inventoryhandler.h
@@ -44,19 +44,20 @@ class InventoryHandler final : public MessageHandler,
~InventoryHandler();
- void handleMessage(Net::MessageIn &msg);
+ void handleMessage(Net::MessageIn &msg) override;
- void equipItem(const Item *item);
+ void equipItem(const Item *const item) const override;
- void unequipItem(const Item *item);
+ void unequipItem(const Item *const item) const override;
- void useItem(const Item *item);
+ void useItem(const Item *const item) const override;
- void dropItem(const Item *item, int amount);
+ void dropItem(const Item *const item, const int amount) const override;
- void closeStorage(int type);
+ void closeStorage(const int type) const override;
- void moveItem2(int source, int slot, int amount, int destination);
+ void moveItem2(const int source, const int slot,
+ const int amount, const int destination) const override;
};
} // namespace EAthena