yupplemayham/YuppleMayham/utility/script.h
2024-06-21 16:59:06 -04:00

28 lines
No EOL
568 B
C++

#ifndef _H_SCRIPT_H
#define _H_SCRIPT_H
#define SOL_ALL_SAFETIES_ON 1
#include <sol/sol.hpp>
#include <memory>
class Script {
public:
sol::state lua;
Script(const std::string& path);
Script(const Script& script);
virtual ~Script() {};
private:
bool loadScript(const std::string& path) {
auto result = lua.script_file(path);
if (!result.valid())
{
sol::error err = result;
std::cerr << "Failed to load script ( " << path << " ) Error: " << err.what() << std::endl;
}
return result.valid();
}
void registerUserTypes();
};
#endif // _H_SCRIPT_H