#pragma once
#include "Deer/DataStore.h"
#include "Deer/Tools/Memory.h"
#include "Deer/Tools/Path.h"

#ifdef DEER_RENDER
#include "DeerRender/GizmoRenderer.h"
#endif

#include <array>
#include <stdint.h>
#include <string>
#include <vector>

namespace Deer {
	class Environment;
	class GizmoRenderer;

	// A scene is a 3d simulation with its environment and voxel world in case
	// of initialized, here things can be simulated
	namespace Scene {
		// Clears all the assets and memory the Scene had conained
		void clear();

		// This is the cycle to execution of scripts and physics
		void initExecution();
		void tickExecution();
		void endExecution();

		bool getExecutingState();
		uint32_t getCurrentExTick();

#ifdef DEER_RENDER
		// This function renders with the default camera in the environment
		void render();
		void render(SceneCamera);

		extern GizmoRenderer gizmoRenderer;
#endif
		extern Environment environment;
	} // namespace Scene

	// Namespace to manage scenes in memory
	namespace DataStore {
		void loadScene(const Path& name);
		void exportScene(const Path& name);

		void exportRuntimeScene();
		void importRuntimeScene();
	} // namespace DataStore
} // namespace Deer
