diff options
author | chai <chaifix@163.com> | 2018-12-04 10:13:03 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-12-04 10:13:03 +0800 |
commit | 8cd03a53878b9d67eb4b13fb546dbd989d8217e2 (patch) | |
tree | d27371aa2d702705dd86d3c2d8a6c4bd8bd7ec96 /src/lua/common | |
parent | 7c0da0c1181ecf333aa784d4cce09bc160dfe908 (diff) |
*proxy->lua object
Diffstat (limited to 'src/lua/common')
-rw-r--r-- | src/lua/common/je_lua.cpp | 10 | ||||
-rw-r--r-- | src/lua/common/je_lua.h | 4 | ||||
-rw-r--r-- | src/lua/common/je_lua_object.cpp (renamed from src/lua/common/je_lua_proxy.cpp) | 8 | ||||
-rw-r--r-- | src/lua/common/je_lua_object.h (renamed from src/lua/common/je_lua_proxy.h) | 2 |
4 files changed, 12 insertions, 12 deletions
diff --git a/src/lua/common/je_lua.cpp b/src/lua/common/je_lua.cpp index 020599d..a56ae4f 100644 --- a/src/lua/common/je_lua.cpp +++ b/src/lua/common/je_lua.cpp @@ -15,17 +15,17 @@ namespace JinEngine static const char* Jin_Lua_Reference_Table = "Jin_Reference_Table"; - Proxy* luax_newinstance(lua_State* L, const char* type, SharedBase* shared) + LuaObject* luax_newinstance(lua_State* L, const char* type, SharedBase* shared) { - Proxy* proxy = static_cast<Proxy*>(luax_newinstance(L, type, sizeof(Proxy))); - if (shared) proxy->bind(shared); + LuaObject* luaObj = static_cast<LuaObject*>(luax_newinstance(L, type, sizeof(LuaObject))); + if (shared) luaObj->bind(shared); luax_getobjectstable(L); - // Add to objects_table, like objects_table[shared] = proxy + // Add to objects_table, like objects_table[shared] = luaObj luax_pushlightuserdata(L, shared); luax_pushvalue(L, -3); luax_settable(L, -3); luax_pop(L, 1); // Pop objects table. - return proxy; + return luaObj; } int luax_getobject(lua_State* L, SharedBase* shared) diff --git a/src/lua/common/je_lua.h b/src/lua/common/je_lua.h index 1396970..b73ac3d 100644 --- a/src/lua/common/je_lua.h +++ b/src/lua/common/je_lua.h @@ -7,7 +7,7 @@ #include "luax/luax.h" #include "je_lua_shared.hpp" -#include "je_lua_proxy.h" +#include "je_lua_object.h" #include "je_lua_reference.h" namespace JinEngine @@ -20,7 +20,7 @@ namespace JinEngine /// /// /// - Proxy* luax_newinstance(lua_State* L, const char* type, SharedBase* shared); + LuaObject* luax_newinstance(lua_State* L, const char* type, SharedBase* shared); /// /// Access lua object by object pointer. diff --git a/src/lua/common/je_lua_proxy.cpp b/src/lua/common/je_lua_object.cpp index b892e67..ce71283 100644 --- a/src/lua/common/je_lua_proxy.cpp +++ b/src/lua/common/je_lua_object.cpp @@ -1,12 +1,12 @@ #include "je_lua.h" -#include "je_lua_proxy.h" +#include "je_lua_object.h" namespace JinEngine { namespace Lua { - void Proxy::bind(SharedBase* s) + void LuaObject::bind(SharedBase* s) { if (s == nullptr) return; @@ -14,7 +14,7 @@ namespace JinEngine shared->retain(); } - void Proxy::release() + void LuaObject::release() { if (shared != nullptr) { @@ -23,7 +23,7 @@ namespace JinEngine } } - const char* Proxy::getObjectType() + const char* LuaObject::getObjectType() { return shared->getType(); } diff --git a/src/lua/common/je_lua_proxy.h b/src/lua/common/je_lua_object.h index 517e209..bd3ddd6 100644 --- a/src/lua/common/je_lua_proxy.h +++ b/src/lua/common/je_lua_object.h @@ -10,7 +10,7 @@ namespace JinEngine namespace Lua { - class Proxy + class LuaObject { public: /// |