#pragma once
#include "scene.h"
#include "singleton.h"
namespace engineapi {
	struct SceneInfo
	{
		Name name;
		Scene* scene = nullptr;
	};
	class SceneManager :public ISingleton<SceneManager> {
	protected:
		SceneInfo* curScene = nullptr;
		table<Name, SceneInfo*> scenes;
	public:
		void Init() override;
		void Shutdown() override;
	public:
		Scene* GetScene(const Name& name);
		void LoadScene(const Name& path, bool switchNow = true);
		void SwitchScene(const Name& name);
		void DeleteScene(const Name& name);
		void DeleteAllScene();
		void ReloadScene();
		void Render();
		void Update();
		Scene* GetCurScene();
		SceneInfo* GetSceneInfo(const Name& name);
	};
}