#ifndef IFLUID_CONTAINING_ITEM_HPP_
#define IFLUID_CONTAINING_ITEM_HPP_

#include <string>

class ItemStack;

/**
 * @brief Interface implemented by `Item` subclasses which contain fluids.
 * 
 * This is used for example by the `BarrelController` to let items interact with the
 * barrel.
 */
class IFluidContainingItem
{
public:
    virtual ~IFluidContainingItem() = default;

    /**
     * @brief Return the name of the contained fluid.
     * 
     * An empty string means no fluid currently contained.
     */
    virtual std::string getFluidName(const ItemStack &stack) = 0;

    /**
     * @brief Return the amount of fluid currently contained.
     */
    virtual int getFluidAmount(const ItemStack &stack) = 0;

    /**
     * @brief Try to pull fluid from the item stack.
     * 
     * @param stack The item stack (this function may modify it).
     * @param fluidName The fluid name we are trying to pull.
     * @param maxToPull Maximum number of ml to pull.
     * @return The number of millimeters successfully pulled (and subtracted from container).
     */
    virtual int pullFluid(ItemStack &stack, std::string fluidName, int maxToPull) = 0;

    /**
     * @brief Try to push fluid into this item.
     * 
     * @param stack The item stack (this function may modify it).
     * @param fluidName The fluid name we are trying to push.
     * @param amount The amount of fluid we are trying to push (ml).
     * @return The number of units actually pushed, and added to the container.
     */
    virtual int pushFluid(ItemStack &stack, std::string fluidName, int amount) = 0;
};

#endif