#ifndef COMBUSTION_GENERATOR_HPP_
#define COMBUSTION_GENERATOR_HPP_

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

class CombustionGenerator : public SpriteBlock, public MachineBlockMixin<MCombustionGenerator>
{
private:
    /*
        #      Combustion Generator Meta Byte
        +-------+---+---+---+---+---+---+---+---+
        | Bit   | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
        +-------+---+---+---+---+---+---+---+---+
        | Field |   |   |   |   |   | A |output |
        +-------+---+---+---+---+---+---+---+---+

        output
            The electric output side.
        
        A
            If set, the generator is active.
    */

    static std::vector<Sprite> makeSprites();

    static constexpr uint8_t metaActive = 1 << 2;
    static constexpr uint8_t numStates = 1 << 3;

public:
    CombustionGenerator(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 glm::vec3 getLightColor(uint8_t meta) override;
    virtual glm::ivec3 getLightOffset(uint8_t meta) 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