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

Method Kill

LuaSTGPlus/GameObjectPool.cpp:760–782  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

758}
759
760int GameObjectPool::Kill(lua_State* L)LNOEXCEPT
761{
762 if (!lua_istable(L, 1))
763 return luaL_error(L, "invalid argument #1, luastg object required for 'Kill'.");
764 lua_rawgeti(L, 1, 2); // t(object) ... id
765 GameObject* p = m_ObjectPool.Data((size_t)luaL_checknumber(L, -1));
766 lua_pop(L, 1); // t(object) ...
767 if (!p)
768 return luaL_error(L, "invalid argument #1, invalid luastg object.");
769
770 if (p->status == STATUS_DEFAULT)
771 {
772 p->status = STATUS_KILL;
773
774 // �������еĻص�����
775 lua_rawgeti(L, 1, 1); // t(object) ... class
776 lua_rawgeti(L, -1, LGOBJ_CC_KILL); // t(object) ... class f(kill)
777 lua_insert(L, 1); // f(kill) t(object) ... class
778 lua_pop(L, 1); // f(kill) t(object) ...
779 lua_call(L, lua_gettop(L) - 1, 0);
780 }
781 return 0;
782}
783
784int GameObjectPool::IsValid(lua_State* L)LNOEXCEPT
785{

Callers

nothing calls this directly

Calls 1

DataMethod · 0.80

Tested by

no test coverage detected