diff options
author | chai <chaifix@163.com> | 2021-10-23 00:31:25 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-10-23 00:31:25 +0800 |
commit | df0444f85f9bf623cc886e1632e624ef20cb0f1b (patch) | |
tree | 4aff1454312540f137bb318349b48e58d9b06d80 /Runtime/Lua/LuaBind/LuaBindEnum.cpp | |
parent | 4dafefe46a72ba47468b13d011f8299055081b0f (diff) |
-member table
Diffstat (limited to 'Runtime/Lua/LuaBind/LuaBindEnum.cpp')
-rw-r--r-- | Runtime/Lua/LuaBind/LuaBindEnum.cpp | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/Runtime/Lua/LuaBind/LuaBindEnum.cpp b/Runtime/Lua/LuaBind/LuaBindEnum.cpp index 63e2567..849fb8a 100644 --- a/Runtime/Lua/LuaBind/LuaBindEnum.cpp +++ b/Runtime/Lua/LuaBind/LuaBindEnum.cpp @@ -34,34 +34,4 @@ namespace LuaBind return luaL_error(L, "Enum called \"%s\" is readonly.", name); } - //--------------------------------------------------------------------------------// -#if LUA_BIND_ENABLE_PLAIN_ENUM - int PlainEnum::registry(lua_State* L) - { - // params: - // 1: enum name - // 2: metatable - - cc8* name = luaL_checkstring(L, 1); - - if (!lua_istable(L, 2)) - { - return luaL_error(L, "Create plain enum failed. Require table, but get %s", luaL_typename(L, 2)); - } - - lua_pushvalue(L, -1); - lua_setfield(L, -2, "__index"); - - lua_pushstring(L, name); - lua_pushcclosure(L, _rmt__newindex, 1); - lua_setfield(L, -2, "__newindex"); - - lua_newtable(L); // enum table - - lua_pushvalue(L, -2); // metatable - lua_setmetatable(L, -2); - - return 1; - } -#endif }
\ No newline at end of file |