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

48 lines
765 B
C
Raw Normal View History

2017-08-08 13:53:47 +02:00
#pragma once
#ifndef _ITEMCONTAINER_H_
#define _ITEMCONTAINER_H_
#include <map>
2017-08-19 00:18:40 +02:00
#include <src/servers/Server_Common/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);
~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);
void setItem(uint8_t slotId, ItemPtr item);
int16_t getFreeSlot();
private:
uint16_t m_id;
uint8_t m_size;
ItemMap m_itemMap;
Entity::PlayerPtr m_pOwner;
};
}
#endif