#pragma once
#include "Entity.h"
#define CS_MAGICTHUNDER_CREATENAME L"CS_magicthunder"
//ÉÁµçÐ§¹û
class CS_MagicThunder :
    public Entity
{
public:
    void Step() override;
    void SetState(int stateID, int lr) override;
    void SetState(std::wstring stateName, int lr) override;
    std::weak_ptr<Entity> GetEntityByEventName(std::wstring eventName);
    std::weak_ptr<Entity> from;
    float from_dx = 0;
    float from_dy = 0;
    std::weak_ptr<Entity> target;
    float target_dx = 0;
    float target_dy = 0;
    bool bSetFrom = false;
    bool bSetFromDxDy = false;
    bool bSetTarget = false;
    bool bSetTargetDxDy = false;
    struct Point
    {
        float x, y;
        Point(float x = 0, float y = 0) : x(x), y(y) {}
    };
    std::vector<CS_MagicThunder::Point> polyline;
    void GeneratePolyline(CS_MagicThunder::Point start, CS_MagicThunder::Point end, int segments);
    void DrawPolyline();
};

std::shared_ptr<Entity> CreateCS_MagicThunder();