Criada classe Mapa; scrolling
[Projeto-PCG.git] / luaenv.cpp
blobf603e0cd36f7be53b391350aa8fefcc9aaa6334d
1 #include "luaenv.h"
3 void luaRun::registerScripts() {
4 registerScript("helloworld.lua");
7 void luaRun::registerScript(const std::string name) {
8 Script novo(name);
9 scripts.push_back(novo);
12 void luaRun::loadScripts() {
13 std::vector<Script >::iterator it;
14 for (it = scripts.begin();it != scripts.end(); it++) {
15 if (it->L != NULL) lua_close(it->L);
16 it->L = lua_open();
17 luaL_openlibs(it->L);
18 if (luaL_dofile(it->L, it->name.c_str())) {
19 printf("%s\n", lua_tostring(it->L, -1));