MCPcopy Create free account
hub / github.com/Tencent/UnLua / UObject_IsA

Function UObject_IsA

Plugins/UnLua/Source/UnLua/Private/BaseLib/LuaLib_Object.cpp:166–187  ·  view source on GitHub ↗

* Test whether this object is of the specified type */

Source from the content-addressed store, hash-verified

164 * Test whether this object is of the specified type
165 */
166static int32 UObject_IsA(lua_State* L)
167{
168 int32 NumParams = lua_gettop(L);
169 if (NumParams != 2)
170 return luaL_error(L, "invalid parameters");
171
172 UObject* Object = UnLua::GetUObject(L, 1);
173 if (!UnLua::IsUObjectValid(Object))
174 return luaL_error(L, "invalid object");
175
176 UObject* ClassObject = UnLua::GetUObject(L, 2);
177 if (!UnLua::IsUObjectValid(ClassObject))
178 return luaL_error(L, "invalid class");
179
180 UClass* Class = Cast<UClass>(ClassObject);
181 if (!Class)
182 return luaL_error(L, "invalid class");
183
184 bool bValid = Object->IsA(Class);
185 lua_pushboolean(L, bValid);
186 return 1;
187}
188
189static int32 UObject_Release(lua_State* L)
190{

Callers

nothing calls this directly

Calls 5

lua_gettopFunction · 0.85
luaL_errorFunction · 0.85
GetUObjectFunction · 0.85
IsUObjectValidFunction · 0.85
lua_pushbooleanFunction · 0.85

Tested by

no test coverage detected