#ifndef IMACHINE_BLOCK_HPP_
#define IMACHINE_BLOCK_HPP_

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

/**
 * @brief Interface implemented by blocks which contain machines.
 */
class IMachineBlock
{
public:
    virtual ~IMachineBlock() = default;

    /**
     * @brief Create an instance of the machine.
     * 
     * If `data` is `nullptr`, then initialize the machine's state to the starting values
     * (when a block is first placed). Otherwise, `data` and `size` point to the serialized
     * machine state, which you should deserialize.
     * 
     * @param world Th world containing the block.
     * @param pos Block position.
     * @return An instance of the `Machine` for this block.
     */
    virtual std::shared_ptr<Machine> initMachine(LocalWorld &world, glm::ivec3 pos) = 0;
};

#endif