Esempio n. 1
0
 /*
  * Creates the metatable for type references
  */
 private void createClassMetatable(LuaCore.lua_State luaState)
 {
     LuaLib.luaL_newmetatable(luaState, "luaNet_class");
     LuaLib.lua_pushstring(luaState, "__gc");
     LuaLib.lua_pushstdcallcfunction(luaState, metaFunctions.gcFunction);
     LuaLib.lua_settable(luaState, -3);
     LuaLib.lua_pushstring(luaState, "__tostring");
     LuaLib.lua_pushstdcallcfunction(luaState, metaFunctions.toStringFunction);
     LuaLib.lua_settable(luaState, -3);
     LuaLib.lua_pushstring(luaState, "__index");
     LuaLib.lua_pushstdcallcfunction(luaState, metaFunctions.classIndexFunction);
     LuaLib.lua_settable(luaState, -3);
     LuaLib.lua_pushstring(luaState, "__newindex");
     LuaLib.lua_pushstdcallcfunction(luaState, metaFunctions.classNewindexFunction);
     LuaLib.lua_settable(luaState, -3);
     LuaLib.lua_pushstring(luaState, "__call");
     LuaLib.lua_pushstdcallcfunction(luaState, metaFunctions.callConstructorFunction);
     LuaLib.lua_settable(luaState, -3);
     LuaLib.lua_settop(luaState, -2);
 }