#ifndef EDITSCENE_EDITOR_SUN_SYSTEM_HPP
#define EDITSCENE_EDITOR_SUN_SYSTEM_HPP
#pragma once

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

/**
 * Sun system - manages directional light and sun/moon spheres
 * based on in-game time.
 */
class EditorSunSystem {
public:
	EditorSunSystem(flecs::world &world, Ogre::SceneManager *sceneMgr);
	~EditorSunSystem();

	// Update sun position, light, and colors
	void update(float deltaTime);

private:
	void rebuildSun(flecs::entity entity, struct SunComponent &sun,
			struct TransformComponent &transform);
	void cleanupSun(SunComponent &sun);
	void createSphere(Ogre::ManualObject *obj, float radius,
			const Ogre::ColourValue &color);

	flecs::world &m_world;
	Ogre::SceneManager *m_sceneMgr;
	flecs::query<struct SunComponent, struct TransformComponent> m_query;
};

#endif // EDITSCENE_EDITOR_SUN_SYSTEM_HPP
