#pragma once
#include <string>
#include "Asset/Asset_ImagePack.h"
#include "EngineFrame/Component/RenderBase.h"
#include "EngineFrame/Render/Texture.h"

class Game;
/**
 * @brief Sprite类，继承自Component类，用于表示游戏中的精灵组件
 */
class Sprite : public RenderBase 
{
protected:
    RefPtr<Texture> m_texture = nullptr;

public:
    Sprite() = default;
    Sprite(std::string imgPath, int Index);
    Sprite(std::string PngPath);
    ~Sprite();
    void Render() override;
    void PreRender() override;
    void Clear() override;
    void Init() override;
    void SetTexture(RefPtr<Texture> texture);

    RefPtr<Texture> GetTexture();

public:
    // 渲染信息
    RenderGuidanceInfo _RenderGuidanceInfo;
    // 混合模式
    LE_BlEND_MODE _BlendMode = NONE;

    std::string imgPath;
    int Index;

public:
    // 计算渲染信息
    void CalcRenderInfoLogic();
    // 设置混合模式
    void SetBlendMode(LE_BlEND_MODE mode);
    // 混合
    void Blend();
    // 获取混合模式
    LE_BlEND_MODE GetBlendMode();
};
