//
// Created by sfd on 25-5-26.
//

#ifndef SCENE_H
#define SCENE_H


#include <Hazel/Core/TimeStep.h>

#include "entt.hpp"
#include "Hazel/Core/Core.h"



namespace Hazel
{
    class Entity;

    class HAZEL_API Scene {
    public:
        Scene();
        ~Scene();

        Entity CreateEntity(const std::string& name = "");

        void DestoryEntity(Entity entity);

        void OnUpdate(TimeStep& ts);
        void OnViewportResize(uint32_t width, uint32_t height);


    private:
        template<typename T>
        void OnComponentAdded(Entity entity, T& component);



    private:
        entt::registry m_Registry;

        uint32_t m_ViewportWidth = 0, m_ViewportHeight = 0;

        friend class Entity;
        friend class SceneHierachyPanel;
    };
}


#endif //SCENE_H
