#pragma once
#include "Entity.h"
//颗粒实体：技能读条
class PeReadyBar :
    public Entity
{
public:
    PeReadyBar(std::shared_ptr<Entity> parent, float* pVal, DWORD color, float dx, float dy,
        bool (*LeaveFunc)(std::weak_ptr<Entity> e),
        void (*DestoryFunc)(std::weak_ptr<Entity> e) = nullptr);
    void Step() override;
    void DeltaTime(float deltaTime) override;//绘制更新
    void Destroy() override;
    void SetShape();
    float* pVal = nullptr;//进度
    float dx = 0;
    float dy = 0;
    bool (*LeaveFunc)(std::weak_ptr<Entity> e) = nullptr;
    void (*DestoryFunc)(std::weak_ptr<Entity> e) = nullptr;
    bool leave = false;
    float fadeInAlpha = 0.0f;
    float fadeOutAlpha = 1.0f;
    std::vector<PenVertex> lineList_set;
    std::vector<PenVertex> lineList_set_last;
    std::vector<PenVertex> fillList_set;
    std::vector<PenVertex> fillList_set_last;
};

