#pragma once #include #include #include #include #if defined(OS_WINDOWS) #include #else #include #endif namespace hex::script::loader { class ScriptLoader; struct Script { std::string name; bool background; std::function entryPoint; const ScriptLoader *loader; }; class ScriptLoader { public: ScriptLoader(std::string typeName) : m_typeName(std::move(typeName)) {} virtual ~ScriptLoader() = default; virtual bool initialize() = 0; virtual bool loadAll() = 0; void addScript(std::string name, bool background, std::function entryPoint) { m_scripts.emplace_back(std::move(name), background, std::move(entryPoint), this); } const auto& getScripts() const { return m_scripts; } const std::string& getTypeName() const { return m_typeName; } protected: void clearScripts() { m_scripts.clear(); } private: std::vector