//
// Created by slinky on 5/7/26.
//

#ifndef B_ENGINE_SCENE_H
#define B_ENGINE_SCENE_H

#include "entt/entt.hpp"

struct SceneObject {
    entt::entity e;
    std::vector<SceneObject*> children;
};

class Scene {
public:
    Scene();
    ~Scene() = default;

    entt::entity create_game_object();
    entt::entity create_game_object(entt::entity parent);

    template<typename T>
    T& attach_component(entt::entity e);
    template<typename T>
    T& attach_component(entt::entity e, T data);

    template<typename T>
    T& fetch_component(entt::entity e);


private:
    entt::registry _registry{};
    entt::entity root;

    void add_child(entt::entity parent, entt::entity child);
};

#endif //B_ENGINE_SCENE_H