#pragma once
#include "Entity.h"
#include "CS_DiscoBallLight.h"
#define CS_DISCOBALL_CREATENAME L"CS_discoball"

struct DiscoBallLightGroup
{
    std::vector<std::weak_ptr<CS_DiscoBallLight>> lights;
    float r = 0;//旋转时使用的半径
};

//迪斯科球
class CS_DiscoBall :
    public Entity
{
public:
    CS_DiscoBall();
    void Init(std::weak_ptr<Entity> self) override;
    void Step() override;
    void SetState(int stateID, int lr);
    void Destroy() override;
    void ClearLight();
    void SetLight(int nLayer, float layerSpacing, float lightSpacing);
    std::vector<DiscoBallLightGroup> group;
    float rotationSpeed = 0.2f;
    int rotation_counter = 0;
    std::vector<int> argbuff;
    int arg_nLayer = -1;
    float arg_layerSpacing = -1;
    float arg_lightSpacing = -1;
    float ball_x = 0;
    float ball_y = 0;
    std::weak_ptr<CS_DiscoBallLight> selfLight;
};

std::shared_ptr<Entity> CreateCS_DiscoBall();