#ifndef MITEM_DEPLOYER_HPP_
#define MITEM_DEPLOYER_HPP_

#include <Machine/Machine.hpp>
#include <Machine/IElectricMachine.hpp>
#include <Machine/IBeltMachine.hpp>
#include <World/IWorldActor.hpp>

class MItemDeployer :
    public Machine,
    public IElectricMachine,
    public IBeltMachine,
    public IWorldActor
{
private:
    Side getOutputSide();
    Side getInputSide();
    Side getUsingSide();

public:
    static constexpr int energyPerItem = 10;

    MItemDeployer(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 bool canConnectElectricWire(Side side) override;
    virtual void onItemStackEntering(Side side, ItemStack &stack) override;
    virtual Side getSideFacing2D() override;
    virtual void getBeltsBranchingFrom(Side side, std::vector<std::shared_ptr<Belt>> &belts) override;
    virtual void update() override;
    virtual bool isUsingItemDirectly() override;
};

#endif