#ifndef ENGINEERING_TABLE_HPP_
#define ENGINEERING_TABLE_HPP_

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

class EngineeringTable : public SpriteBlock, public MachineBlockMixin<MEngineeringTable>
{
private:
    static std::vector<Sprite> makeSprites();

public:
    /*

        #         Engineering Table Meta Byte
        +-------+---+---+---+---+---+---+---+---+
        | Bit   | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
        +-------+---+---+---+---+---+---+---+---+
        | Field |   |   |   |   |   | A | orient|
        +-------+---+---+---+---+---+---+---+---+

        orient
            The side from which we input electricity.
        
        A
            If set, engineering table is currently producing.

    */

    static constexpr uint8_t metaActive = (1 << 2);

    EngineeringTable(std::string name);

    virtual bool canManuallyDig() override;
    virtual void onInteract(LocalWorld &world, Player &player, glm::ivec3 pos, Side side, const RGBABytes &collisionKey) override;
    virtual void getHarvestedStacks(LocalWorld &world, glm::ivec3 pos, std::vector<ItemStack> &stacks) override;
    virtual Sound& getBackgroundSound(uint8_t meta) override;
    virtual bool canPlace(LocalWorld &world, IWorldActor &actor, glm::ivec3 pos, Side side, uint8_t &meta) override;
};

#endif