#ifndef LOGIC_BOX_HPP_
#define LOGIC_BOX_HPP_


#include <Block/SpriteBlock/SpriteBlock.hpp>
#include <Block/MachineBlockMixin.hpp>
#include <Machine/MLogicBox/MLogicBox.hpp>

class LogicBox final : public SpriteBlock, public MachineBlockMixin<MLogicBox>
{
private:
    static std::vector<Sprite> makeSprites();

public:
    /*

        #            Logic Box Meta Byte
        +-------+---+---+---+---+---+---+---+---+
        | Bit   | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
        +-------+---+---+---+---+---+---+---+---+
        | Field |   |   |   |   |   |   |   in  |
        +-------+---+---+---+---+---+---+---+---+

        in
            The input side number.
    */

    LogicBox(std::string name);

    virtual bool canManuallyDig() override;
    virtual void onInteract(LocalWorld &world, Player &player, glm::ivec3 pos, Side side, const RGBABytes &collisionKey) override;
    virtual bool canPlace(LocalWorld &world, IWorldActor &actor, glm::ivec3 pos, Side side, uint8_t &meta) override;
};
#endif