#ifndef QUARTZ_CLOCK_HPP_
#define QUARTZ_CLOCK_HPP_

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

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

public:
    /*

        #           Quartz Clock Meta Byte
        +-------+---+---+---+---+---+---+---+---+
        | Bit   | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
        +-------+---+---+---+---+---+---+---+---+
        | Field |   |   |   |   |   |   | orient|
        +-------+---+---+---+---+---+---+---+---+

        orient
            The side from which we output data signals.
    */

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

    QuartzClock(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