#ifndef MFLUID_DISPENSER_HPP_
#define MFLUID_DISPENSER_HPP_

#include <Machine/Machine.hpp>
#include <Machine/IFluidMachine.hpp>

class MFluidDispenser final :
    public Machine,
    public IFluidMachine
{
private:
    static constexpr int capacity = 256;

    std::optional<std::string> storedFluid;

    Side getOutputSide();
    Side getInputSide();

public:
    MFluidDispenser(LocalWorld &world, glm::ivec3 pos);

    virtual void serializeState(std::vector<uint8_t> &outBytes) override;
    virtual void deserializeState(const uint8_t *data, size_t size) override;
    virtual void update() override;
    virtual bool canConnectFluidPipe(Side side) override;
    virtual int getMaxFluidToAccept(std::optional<Side> side, std::string fluidName) override;
};

#endif