summaryrefslogtreecommitdiff
path: root/src/net/ea
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-10-17 22:11:13 +0300
committerAndrei Karas <akaras@inbox.ru>2014-10-17 22:11:13 +0300
commit9a40e1202946e3384500da28668a52d28ad377f4 (patch)
tree6b031263af767043249c8aa8b733e1cc84a0aa85 /src/net/ea
parentcd7c69edecf4b04ad7c2b40092d29b0444acfa28 (diff)
downloadplus-9a40e1202946e3384500da28668a52d28ad377f4.tar.gz
plus-9a40e1202946e3384500da28668a52d28ad377f4.tar.bz2
plus-9a40e1202946e3384500da28668a52d28ad377f4.tar.xz
plus-9a40e1202946e3384500da28668a52d28ad377f4.zip
Add static in inventoryhandler.
Diffstat (limited to 'src/net/ea')
-rw-r--r--src/net/ea/inventoryhandler.cpp22
-rw-r--r--src/net/ea/inventoryhandler.h23
2 files changed, 26 insertions, 19 deletions
diff --git a/src/net/ea/inventoryhandler.cpp b/src/net/ea/inventoryhandler.cpp
index 2c8c64cda..f4250efc5 100644
--- a/src/net/ea/inventoryhandler.cpp
+++ b/src/net/ea/inventoryhandler.cpp
@@ -88,14 +88,22 @@ const Equipment::Slot EQUIP_CONVERT[] =
namespace Ea
{
-InventoryHandler::InventoryHandler() :
- mEquips(),
- mInventoryItems(),
- mStorage(nullptr),
- mStorageWindow(nullptr),
- mDebugInventory(true),
- mSentPickups()
+EquipBackend InventoryHandler::mEquips;
+InventoryItems InventoryHandler::mInventoryItems;
+Inventory *InventoryHandler::mStorage = nullptr;
+InventoryWindow *InventoryHandler::mStorageWindow = nullptr;
+PickupQueue InventoryHandler::mSentPickups;
+bool InventoryHandler::mDebugInventory = true;
+
+InventoryHandler::InventoryHandler()
{
+ mEquips.clear();
+ mInventoryItems.clear();
+ mStorage = nullptr;
+ mStorageWindow = nullptr;
+ while (!mSentPickups.empty())
+ mSentPickups.pop();
+ mDebugInventory = true;
}
InventoryHandler::~InventoryHandler()
diff --git a/src/net/ea/inventoryhandler.h b/src/net/ea/inventoryhandler.h
index e0bfb6a1f..f82cf5780 100644
--- a/src/net/ea/inventoryhandler.h
+++ b/src/net/ea/inventoryhandler.h
@@ -43,6 +43,7 @@ namespace Ea
{
typedef std::vector<InventoryItem> InventoryItems;
+typedef std::queue<int> PickupQueue;
class InventoryHandler notfinal : public Net::InventoryHandler
{
@@ -86,15 +87,15 @@ class InventoryHandler notfinal : public Net::InventoryHandler
static void processItemUseResponse(Net::MessageIn &msg);
- void processPlayerStorageStatus(Net::MessageIn &msg);
+ static void processPlayerStorageStatus(Net::MessageIn &msg);
- void processPlayerStorageRemove(Net::MessageIn &msg);
+ static void processPlayerStorageRemove(Net::MessageIn &msg);
- void processPlayerStorageClose(Net::MessageIn &msg);
+ static void processPlayerStorageClose(Net::MessageIn &msg);
static void processPlayerAttackRange(Net::MessageIn &msg);
- void processPlayerArrowEquip(Net::MessageIn &msg);
+ static void processPlayerArrowEquip(Net::MessageIn &msg);
void closeStorage() override final;
@@ -106,14 +107,12 @@ class InventoryHandler notfinal : public Net::InventoryHandler
protected:
InventoryHandler();
- EquipBackend mEquips;
- InventoryItems mInventoryItems;
- Inventory *mStorage;
- InventoryWindow *mStorageWindow;
- bool mDebugInventory;
-
- typedef std::queue<int> PickupQueue;
- PickupQueue mSentPickups;
+ static EquipBackend mEquips;
+ static InventoryItems mInventoryItems;
+ static Inventory *mStorage;
+ static InventoryWindow *mStorageWindow;
+ static PickupQueue mSentPickups;
+ static bool mDebugInventory;
};
} // namespace Ea