summaryrefslogtreecommitdiff
path: root/src/game-server/inventory.cpp
diff options
context:
space:
mode:
authorGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-07-07 18:06:29 +0000
committerGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-07-07 18:06:29 +0000
commitd213cdea38ae5dda3c1cbdc6c85a2c5fe04e9399 (patch)
tree2ae7c7abd8fdedb2e6ec5610718834d9a92a467f /src/game-server/inventory.cpp
parent04e694b067a21dee8e13368c17d1815cc0624ce4 (diff)
downloadmanaserv-d213cdea38ae5dda3c1cbdc6c85a2c5fe04e9399.tar.gz
manaserv-d213cdea38ae5dda3c1cbdc6c85a2c5fe04e9399.tar.bz2
manaserv-d213cdea38ae5dda3c1cbdc6c85a2c5fe04e9399.tar.xz
manaserv-d213cdea38ae5dda3c1cbdc6c85a2c5fe04e9399.zip
Singleton managers do not need stateful classes. Changed them to namespace interfaces.
Diffstat (limited to 'src/game-server/inventory.cpp')
-rw-r--r--src/game-server/inventory.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/game-server/inventory.cpp b/src/game-server/inventory.cpp
index c8cea6de..4204304f 100644
--- a/src/game-server/inventory.cpp
+++ b/src/game-server/inventory.cpp
@@ -27,6 +27,7 @@
#include "defines.h"
#include "game-server/gamehandler.hpp"
#include "game-server/inventory.hpp"
+#include "game-server/item.hpp"
#include "game-server/itemmanager.hpp"
#include "net/messageout.hpp"
@@ -181,7 +182,7 @@ int Inventory::fillFreeSlot(int itemId, int amount, int maxPerSlot)
int Inventory::insert(int itemId, int amount)
{
int slot = 0;
- int maxPerSlot = itemManager->getItem(itemId)->getMaxPerSlot();
+ int maxPerSlot = ItemManager::getItem(itemId)->getMaxPerSlot();
for (std::vector< InventoryItem >::iterator i = poss.inventory.begin(),
i_end = poss.inventory.end(); i != i_end; ++i)
@@ -323,7 +324,7 @@ bool Inventory::equip(int slot)
int availableSlots = 0, firstSlot = 0, secondSlot = 0;
- switch (itemManager->getItem(itemId)->getType())
+ switch (ItemManager::getItem(itemId)->getType())
{
case ITEM_EQUIPMENT_TWO_HANDS_WEAPON:
{
@@ -405,7 +406,7 @@ bool Inventory::equip(int slot)
{
case 2:
if (id && !poss.equipment[secondSlot] &&
- itemManager->getItem(id)->getType() !=
+ ItemManager::getItem(id)->getType() !=
ITEM_EQUIPMENT_TWO_HANDS_WEAPON)
{
// The first slot is full and the second slot is empty.