#ifndef BARREL_HPP_
#define BARREL_HPP_

#include <Block/SpriteBlock/SpriteBlock.hpp>
#include <Block/MachineBlockMixin.hpp>
#include <Machine/MBarrel/MBarrel.hpp>
#include <Serialize/Serialize.hpp>

enum class BarrelTier : uint8_t
{
    Wooden,
    Steel,
    Lead,
};

class Barrel : public SpriteBlock, public MachineBlockMixin<MBarrel>
{
private:
    BarrelTier tier;

    std::string getTexName(BarrelTier tier);

public:
    Barrel(std::string name, std::string displayName, float hardness, BarrelTier tier);

    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;

    friend class MBarrel;
    friend class BarrelController;
};

DERIVE_STATIC_CAST_SERIALIZER(BarrelTier, uint8_t);

#endif