MCPcopy Create free account
hub / github.com/9chu/LuaSTGPlus / Del

Method Del

LuaSTGPlus/GameObjectPool.cpp:736–758  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

734}
735
736int GameObjectPool::Del(lua_State* L)LNOEXCEPT
737{
738 if (!lua_istable(L, 1))
739 return luaL_error(L, "invalid argument #1, luastg object required for 'Del'.");
740 lua_rawgeti(L, 1, 2); // t(object) ... id
741 GameObject* p = m_ObjectPool.Data((size_t)luaL_checknumber(L, -1));
742 lua_pop(L, 1); // t(object) ...
743 if (!p)
744 return luaL_error(L, "invalid argument #1, invalid luastg object.");
745
746 if (p->status == STATUS_DEFAULT)
747 {
748 p->status = STATUS_DEL;
749
750 // �������еĻص�����
751 lua_rawgeti(L, 1, 1); // t(object) ... class
752 lua_rawgeti(L, -1, LGOBJ_CC_DEL); // t(object) ... class f(del)
753 lua_insert(L, 1); // f(del) t(object) ... class
754 lua_pop(L, 1); // f(del) t(object) ...
755 lua_call(L, lua_gettop(L) - 1, 0);
756 }
757 return 0;
758}
759
760int GameObjectPool::Kill(lua_State* L)LNOEXCEPT
761{

Callers

nothing calls this directly

Calls 1

DataMethod · 0.80

Tested by

no test coverage detected