You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
984 B
C++
37 lines
984 B
C++
/******************************************************************************
|
|
* File - scriptManager.h
|
|
* Author - Joey Pollack
|
|
* Date - 2021/08/30 (y/m/d)
|
|
* Mod Date - 2021/09/02 (y/m/d)
|
|
* Description - Manage the main LUA state, Run given scripts and check for
|
|
* errors. Report errors in the debug log. Also keep a
|
|
* history of errors that can be queried.
|
|
******************************************************************************/
|
|
|
|
#ifndef SCRIPT_MANAGER_H_
|
|
#define SCRIPT_MANAGER_H_
|
|
|
|
#include <sol/sol.hpp>
|
|
#include <utils/opRes.h>
|
|
|
|
namespace lunarium
|
|
{
|
|
class ScriptManager
|
|
{
|
|
public:
|
|
static ScriptManager& GetInstance();
|
|
static void FreeInstance();
|
|
|
|
OpRes Initialize();
|
|
static OpRes RunScript(const char* code);
|
|
|
|
private:
|
|
static ScriptManager* mpInstance;
|
|
sol::state mState;
|
|
uint32_t mCat;
|
|
|
|
friend class CoreAPI;
|
|
};
|
|
}
|
|
|
|
#endif // SCRIPT_MANAGER_H_
|