#ifndef BELT_COMPONENT_HPP_
#define BELT_COMPONENT_HPP_

#include <MachineComponent/MachineComponent.hpp>
#include <Machine/IBeltMachine.hpp>
#include <ItemStack/ItemStack.hpp>
#include <Belt/Belt.hpp>
#include <Side/Side.hpp>

/**
 * @brief Machine component for managing belts.
 */
class BeltComponent : public MachineComponent
{
private:
    Machine &machine;
    IBeltMachine &beltMachine;
    std::shared_ptr<Belt> outputBelts[6];

public:
    static std::string tagName;
    
    BeltComponent(Machine &machine);

    /**
     * @brief Returns the output belt for the specified side.
     */
    std::shared_ptr<Belt> getOutputBelt(Side side);
    
    virtual void serializeState(std::vector<uint8_t> &outBytes) override;
    virtual void deserializeState(const uint8_t *bytes, size_t size) override;
    virtual void onRemoving() override;
};

#endif