#ifndef IBAG_HPP_
#define IBAG_HPP_

#include <Controller/InventoryController/InventoryController.hpp>
#include <ItemStack/ItemStack.hpp>
#include <ItemStore/ItemStore.hpp>
#include <Widget/Widget.hpp>

/**
 * @brief Interface implemented by items that contain other items.
 */
class IBag 
{
public:
    virtual ~IBag() = default;

    /**
     * @brief Returns the `ItemStore` contained in this bag.
     */
    virtual ItemStore& bagStore(ItemStack &stack) = 0;

    /**
     * @brief Returns the number of slots in the item store.
     */
    virtual int getNumBagSlots() = 0;

    /**
     * @brief Create the bag control widget, which will be displayed in the Inventory panel.
     */
    virtual Widget* createBagWidget(InventoryController &ctrl, const std::string &bagInvId, ItemStack &stack, int equipmentSlot) = 0;

    /**
     * @brief Apply a transformation on this stack.
     * 
     * @param stack The stack to apply the change to.
     * @param cmd The command; specifies what to do and how to interpret data.
     * @param data The command data.
     */
    virtual void applyBagTransform(ItemStack &stack, const std::string &cmd, const std::vector<uint8_t> &data) = 0;
};

#endif