#include "Deer/Scene.h"

#include "Deer/Components.h"
#include "Deer/Enviroment.h"
#include "Deer/Log.h"
#include "Deer/Tools/Memory.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/FrameBuffer.h"
#include "DeerRender/Mesh.h"
#include "DeerRender/Shader.h"
#include "DeerRender/Voxels/VoxelWorldRenderData.h"
#endif

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

#ifdef DEER_RENDER
		ResourceManager<Shader>::unloadResources();
		ResourceManager<GPUMesh>::unloadResources();
		ResourceManager<FrameBuffer>::unloadResources();
#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;
	}

} // namespace Deer
