#ifndef NUCLEAR_REACTOR_HPP_
#define NUCLEAR_REACTOR_HPP_

#include <Block/SpriteBlock/MultiBlock/MultiBlock.hpp>
#include <Block/MachineBlockMixin.hpp>
#include <Machine/MNuclearReactor/MNuclearReactor.hpp>

class NuclearReactor : public MultiBlock, public MachineBlockMixin<MNuclearReactor>
{
public:
    /*
        #        Nuclear Reactor Meta Byte
        +-------+---+---+---+---+---+---+---+---+
        | Bit   | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
        +-------+---+---+---+---+---+---+---+---+
        | Field |   |   |   |   | M | R | orient|
        +-------+---+---+---+---+---+---+---+---+

        orient
            The orientation of the multi-block structure.
        
        R
            If set, it means the reactor is having significant reactions.
        
        M
            If set, it means the reactor is in meltdown.
    */

    static constexpr uint8_t metaReacting = 1 << 2;
    static constexpr uint8_t metaMeltdown = 1 << 3;

    NuclearReactor(std::string name);

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

#endif