mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-02 08:57:44 +00:00
47 lines
730 B
C++
47 lines
730 B
C++
#ifndef _ITEMCONTAINER_H_
|
|
#define _ITEMCONTAINER_H_
|
|
|
|
#include <map>
|
|
|
|
#include <Common.h>
|
|
|
|
#include "Forwards.h"
|
|
|
|
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
|