#ifndef COMPONENTS_LUA_CONFIGURATION_H #define COMPONENTS_LUA_CONFIGURATION_H #include #include #include "components/esm/luascripts.hpp" namespace LuaUtil { class ScriptsConfiguration { public: void init(ESM::LuaScriptsCfg); size_t size() const { return mScripts.size(); } const ESM::LuaScriptCfg& operator[](int id) const { return mScripts[id]; } std::optional findId(std::string_view path) const; const std::vector& getListByFlag(ESM::LuaScriptCfg::Flags type) const; private: std::vector mScripts; std::map> mPathToIndex; std::map> mScriptsByFlag; static const std::vector sEmpty; }; // Parse ESM::LuaScriptsCfg from text and add to `cfg`. void parseOMWScripts(ESM::LuaScriptsCfg& cfg, std::string_view data); std::string scriptCfgToString(const ESM::LuaScriptCfg& script); } #endif // COMPONENTS_LUA_CONFIGURATION_H