1 #include "configmanager.h"
4 static std::map
<std::string
, int> *scr
= NULL
;
5 static std::map
<std::string
, Ponto
> *play
= NULL
;
6 static std::list
<std::string
> *m
= NULL
;
8 static int regscreen(lua_State
*L
) {
9 const char *name
= lua_tostring(L
, 1);
10 double value
= lua_tonumber(L
, 2);
11 (*scr
)[name
] = (int) value
;
15 static int regplayer(lua_State
*L
) {
16 const char *name
= lua_tostring(L
, 1);
17 double x
= lua_tonumber(L
, 2);
18 double y
= lua_tonumber(L
, 3);
19 (*play
)[name
] = Ponto(x
, y
);
23 static int regmap(lua_State
*L
) {
24 m
->push_front(lua_tostring(L
, 1));
28 ConfigManager::ConfigManager() {
32 void ConfigManager::load() {
42 registerFunction(lstate
, "regscreen", regscreen
);
43 registerFunction(lstate
, "regplayer", regplayer
);
44 registerFunction(lstate
, "regmap", regmap
);
45 doLuaFile(lstate
,"configmanager.lua");
46 doLuaFile(lstate
,"config.lua");