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

56 lines
973 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
2018-06-02 15:52:35 +02:00
#include "Forwards.h"
2017-08-08 13:53:47 +02:00
namespace Core
{
using ItemMap = std::map< uint8_t, ItemPtr >;
2017-08-08 13:53:47 +02:00
class ItemContainer
{
public:
ItemContainer( uint16_t storageId, uint8_t maxSize, const std::string& tableName, bool isMultiStorage );
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
int8_t getFreeSlot();
2017-08-08 13:53:47 +02:00
uint8_t getMaxSize() const;
std::string getTableName() const;
bool isMultiStorage() const;
2017-08-08 13:53:47 +02:00
private:
uint16_t m_id;
uint8_t m_size;
std::string m_tableName;
bool m_bMultiStorage;
2017-08-08 13:53:47 +02:00
ItemMap m_itemMap;
Entity::PlayerPtr m_pOwner;
};
}
#endif