Skip to content
Snippets Groups Projects
script-lua.h 518 B
Newer Older
Vicki Pfau's avatar
Vicki Pfau committed
#pragma once

#include "script.h"

#include <unordered_set>

#include <lua.hpp>

namespace Retro {

class ScriptLua final : public ScriptContext {
public:
	static std::shared_ptr<ScriptContext> create();

	~ScriptLua();

	void setData(const GameData*) override;
	bool init() override;
	bool load(const std::string&) override;
	Variant callFunction(const std::string&) override;
	std::vector<std::string> listFunctions() override;

private:
	lua_State* m_L = nullptr;
	std::unordered_set<std::string> m_blacklist;
};
}