Skip to content

File ScriptComponent.hpp

File List > Engine > include > Scripting > ScriptComponent.hpp

Go to the documentation of this file

#ifndef ENGINE_SCRIPTING_SCRIPTCOMPONENT_HPP_
#define ENGINE_SCRIPTING_SCRIPTCOMPONENT_HPP_

#include <sol/sol.hpp>
#include <string>

namespace Engine {
struct ScriptComponent {
    std::string scriptPath;

    bool autoReload = true;

    bool loaded = false;

    sol::table scriptTable = sol::lua_nil;

    ScriptComponent() = default;
    explicit ScriptComponent(const std::string& path, bool autoReload_ = true)
        : scriptPath(path), autoReload(autoReload_) {}
};
} // namespace Engine

#endif // ENGINE_SCRIPTING_SCRIPTCOMPONENT_HPP_