#include "Deer/Scene.h"

#include "Deer/ComponentScript.h"
#include "Deer/Components.h"
#include "Deer/Enviroment.h"
#include "Deer/Log.h"
#include "Deer/Memory.h"
#include "Deer/ScriptEngine.h"
#include "Deer/VoxelWorld.h"
#include "Deer/Voxels/Chunk.h"
#include "Deer/Voxels/Layer.h"
#include "Deer/Voxels/VoxelWorldData.h"

#include "Deer/Enviroment.h"
#include "Deer/Scene/SceneData.h"

#ifdef DEER_RENDER
#include "DeerRender/Voxels/VoxelWorldRenderData.h"
#include "DeerRender/Mesh.h"
#include "DeerRender/Shader.h"
#include "DeerRender/FrameBuffer.h"
#endif

namespace Deer {
	void Scene::clear() {
		environment.clear();
		VoxelWorld::clear();

#ifdef DEER_RENDER
		MeshManager::unloadAllModels();
		ShaderManager::unloadAllShaders();
		FrameBufferManager::unloadAllFrameBuffer();
#endif
	}

	bool Scene::getExecutingState() {
		return isExecuting;
	}

	void Scene::initExecution() {
		DEER_CORE_ASSERT(!isExecuting, "Deer scene is already executing");
		isExecuting = true;
	}

	void Scene::tickExecution() {
		
	}
	
	void Scene::endExecution() {
		DEER_CORE_ASSERT(isExecuting, "Deer scene is not executing");
		isExecuting = false;

		
		DEER_CORE_INFO("Stoping Scene...");
	}

}  // namespace Deer
