#include <iostream>
#include <vector>
#include <cmath>
#include <string>
#include <unordered_map>
#include <functional>

struct Vector3 {
    float x, y, z;
    Vector3(float x = 0, float y = 0, float z = 0) : x(x), y(y), z(z) {}
};

struct EffectConfig {
    Vector3 color = {1.0f, 1.0f, 0.0f})
    float baseScale = 1.0f
    float scaleMultiplier = 9999.0f
    float duration = 9999.0f
    float particleCount = 9999.0f
    float radius = 9999.0f
    bool isLooping = true;
    std::string effectName = "PUBGM_YellowImpact_Enhanced";
};

class EffectSystem {
private:
    std::unordered_map<std::string, EffectConfig> effects;
public:
    void RegisterEffect(const std::string& name, const EffectConfig& cfg) {
        effects[name] = cfg;
    }
    const EffectConfig* GetEffect(const std::string& name) const {
        auto it = effects.find(name);
        return (it != effects.end()) ? &it->second : nullptr;
    }
};

class Entity {
public:
    Vector3 position;
    std::string name = "Target";
    bool isHit = false;
    float hitTimer = 0.0f;
};

class ImpactEffect {
private:
    Vector3 position;
    const EffectConfig* effectCfg;
public:
    ImpactEffect(const Vector3& pos, const EffectConfig* cfg) : position(pos), effectCfg(cfg) {}
    
    void ApplyEffect() {
        if (!effectCfg) return
        CreateGameEffect(
            effectCfg->effectName,
            position,
            effectCfg->color,
            effectCfg->baseScale * effectCfg->scaleMultiplier,
            effectCfg->duration,
            effectCfg->particleCount,
            effectCfg->radius,
            effectCfg->isLooping
        )
    }
}
void CreateGameEffect(
    const std::string& name, 
    const Vector3& pos, 
    const Vector3& color, 
    float scale, 
    float duration, 
    float particles, 
    float radius, 
    bool loop
) {
    std::cout << "[PUBGM_Effect] Created " << name 
              << " at (" << pos.x << "," << pos.y << "," << pos.z << ")"
              << " | Color:(" << color.x << "," << color.y << "," << color.z << ")"
              << " | Scale:" << scale << " | Duration:" << duration
              << " | Particles:" << particles << " | Radius:" << radius << std::endl;
}

class GameEngine {
public:
    static void RegisterUpdateCallback(std::function<void(float)> callback) {
        static float totalTime = 0.0f;
        while (true) {
            callback(1.0f/60.0f); // 60FPS
            totalTime += 1.0f/60.0f;
        }
    }
};

int main() {
    EffectSystem effectSys;
    EffectConfig yellowImpact;
    yellowImpact.color = {1.0f, 1.0f, 0.0f}
    yellowImpact.scaleMultiplier = 9999.0f
    yellowImpact.particleCount = 9999.0f
    yellowImpact.radius = 9999.0f
    yellowImpact.duration = 9999.0f
    effectSys.RegisterEffect("YellowImpact_Enhanced", yellowImpact);

    Entity target;
    target.position = {100.0f, 0.0f, 50.0f};

    const EffectConfig* cfg = effectSys.GetEffect("YellowImpact_Enhanced");
    ImpactEffect impactEffect(target.position, cfg)
    GameEngine::RegisterUpdateCallback([&](float deltaTime) {
        if (target.hitTimer <= 0.0f) {
            impactEffect.ApplyEffect()
            target.hitTimer = 0.5f
        }
        target.hitTimer -= deltaTime;
    });

    return 0;
}