#ifndef IFLUID_MACHINE_HPP_
#define IFLUID_MACHINE_HPP_

#include <string>
#include <optional>

#include <World/LocalWorld/LocalWorld.hpp>

/**
 * @brief Interface implemented by machines which interact with fluid pipelines.
 */
class IFluidMachine
{
public:
    virtual ~IFluidMachine() = default;

    /**
     * @brief Return true if fluid pipes can be connected on the specified side of the
     * block.
     */
    virtual bool canConnectFluidPipe(Side side) = 0;

    /**
     * @brief Get the maximum amount of fluid that can be accepted through a side.
     *
     * This method can have side effects on the machine, for example by marking the
     * fluid as the default fluid for this side. By default always returns 0.
     * 
     * @param side The side that we would accept on (`std::nullopt` means from item, not side).
     * @param fluidName The name of the fluid (e.g. "main:water").
     * @return The maximum amount of this fluid to accept (ml).
     */
    virtual int getMaxFluidToAccept(std::optional<Side> side, std::string fluidName);

    /**
     * @brief Get the maximum amount of fluid that can be released through a side.
     *
     * This method can have side effects on the machine. By default always returns 0.
     * 
     * @param side The side that we would release from (`std::nullopt` means from item, not side).
     * @param fluidName The name of the fluid (e.g. "main:water").
     * @return The maximum amount of this fluid to release (ml).
     */
    virtual int getMaxFluidToRelease(std::optional<Side> side, std::string fluidName);
};

#endif