#ifndef BASIC_BLOCK_HPP_
#define BASIC_BLOCK_HPP_

#include <Block/SpriteBlock/SpriteBlock.hpp>

/**
 * @brief Represents a basic block with the same texture on all sides.
 */
class BasicBlock : public SpriteBlock
{
private:
    bool allowManualDigging;
    Sound* manualDigSound;
    std::string fallbackScriptName;

protected:
    BlockAtlas::SpriteID spriteId;

public:
    BasicBlock(
        std::string name,
        std::string displayName,
        float hardness,
        std::string textureName,
        BoundingBox<int> bounds = {0, 0, 0, 8, 8, 8}
    );

    BasicBlock(
        std::string name,
        std::string displayName,
        float hardness,
        std::array<std::string, 6> sideTextureNames,
        BoundingBox<int> bounds = {0, 0, 0, 8, 8, 8},
        std::string iconName = ""
    );

    /**
     * @brief Indicate that this block can be dug manually.
     * 
     * @param sound The digging sound.
     * 
     * @return The reference to the block itself.
     */
    BasicBlock& digManually(Sound &sound = Sound::NONE);

    BasicBlock& withFallbackScript(std::string name);

    virtual bool canManuallyDig() override;
    virtual Sound& getManualDiggingSound() override;
    virtual void onDesignerInitializing(BlockSpriteDesigner &designer, ScriptEngine &engine) override;
};

#endif