30 lines
660 B
C++
30 lines
660 B
C++
#ifndef SCRIPTNODE_H
|
|
#define SCRIPTNODE_H
|
|
|
|
#include "scene/graphicalnode.h"
|
|
#include "sol.hpp"
|
|
|
|
class ScriptNode : public GraphicalNode
|
|
{
|
|
|
|
sol::state m_script;
|
|
std::vector<std::string> functions_name;
|
|
|
|
public:
|
|
ScriptNode();
|
|
void update();
|
|
void execute(std::string);
|
|
std::vector<std::string> possibleCompletion(std::string);
|
|
|
|
/* -- LUA function -- */
|
|
void print(std::string);
|
|
void version();
|
|
void clear();
|
|
float getDeltaTime();
|
|
sol::state& getScriptEngine() { return m_script; }
|
|
void addAutoCompletionSymbol(const std::string& symbolName) { functions_name.push_back(symbolName); }
|
|
|
|
};
|
|
|
|
#endif // SCRIPTNODE_H
|