1 #ifndef __GS__INVENTORYMANAGER_H__
2 #define __GS__INVENTORYMANAGER_H__
4 #include <boost/smart_ptr/shared_ptr.hpp>
6 #include <GameServ/GameLayer/GameObjects/ItemGO.h>
7 using GameServ::GameLayer::GameObjects::ItemGO
;
15 namespace GameServ
{ namespace GameLayer
{ namespace Helpers
{
18 typedef list
< boost::shared_ptr
<ItemGO
> > ItemList
;
19 typedef map
<string
, ItemList
> PlayerInventoryMap
;
22 class InventoryManager
27 static boost::shared_ptr
<InventoryManager
> Instance();
29 void AddItem(const string
&PlayerId
, boost::shared_ptr
<ItemGO
> spItem
);
30 void RemoveItem(const string
&PlayerId
, boost::shared_ptr
<ItemGO
> spItem
);
31 ItemList
GetInventory(const string
&PlayerId
) const;
32 bool PlayerHasInventory(const string
&PlayerId
) const;
38 PlayerInventoryMap mInventoryTable
;
39 static boost::shared_ptr
<InventoryManager
> mInstance
;
41 }; // InventoryManager
43 }}} // GameServ::GameLayer::Helpers