1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-05-03 17:27:47 +00:00
sapphire/src/servers/sapphire_zone/Inventory/ItemContainer.h

48 lines
733 B
C
Raw Normal View History

2017-08-08 13:53:47 +02:00
#ifndef _ITEMCONTAINER_H_
#define _ITEMCONTAINER_H_
#include <map>
2018-03-06 22:22:19 +01:00
#include <Common.h>
2017-08-08 13:53:47 +02:00
#include "../Forwards.h"
2017-08-08 13:53:47 +02:00
namespace Core
{
typedef std::map< uint8_t, ItemPtr > ItemMap;
class ItemContainer
{
public:
ItemContainer( uint16_t locationId );
2017-08-08 13:53:47 +02:00
~ItemContainer();
uint16_t getId() const;
uint8_t getEntryCount() const;
void removeItem( uint8_t slotId );
ItemMap& getItemMap();
const ItemMap& getItemMap() const;
ItemPtr getItem( uint8_t slotId );
2017-08-08 13:53:47 +02:00
void setItem( uint8_t slotId, ItemPtr item );
2017-08-08 13:53:47 +02:00
int16_t getFreeSlot();
private:
uint16_t m_id;
uint8_t m_size;
ItemMap m_itemMap;
Entity::PlayerPtr m_pOwner;
};
}
#endif