#ifndef EDITSCENE_LIGHTSYSTEM_HPP
#define EDITSCENE_LIGHTSYSTEM_HPP
#pragma once

#include <flecs.h>
#include <Ogre.h>

/**
 * Light system - manages Ogre::Light objects for entities with LightComponent
 */
class EditorLightSystem {
public:
	EditorLightSystem(flecs::world& world, Ogre::SceneManager* sceneMgr);
	~EditorLightSystem();

	// Update lights (process dirty components)
	void update();

	// Process all lights immediately (e.g., after scene load)
	void processAllLights();

private:
	// Create/update a light from component
	void updateLight(flecs::entity entity, class LightComponent& light, 
	                 class TransformComponent& transform);

	// Remove a light
	void removeLight(LightComponent& light);

	flecs::world& m_world;
	Ogre::SceneManager* m_sceneMgr;
	
	// Query for entities with Light and Transform
	flecs::query<class LightComponent, class TransformComponent> m_lightQuery;
};

#endif // EDITSCENE_LIGHTSYSTEM_HPP
