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

Method IsValid

LuaSTGPlus/GameObjectPool.cpp:784–816  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

782}
783
784int GameObjectPool::IsValid(lua_State* L)LNOEXCEPT
785{
786 if (lua_gettop(L) != 1)
787 return luaL_error(L, "invalid argument count, 1 argument required for 'IsValid'.");
788 if (!lua_istable(L, -1))
789 {
790 lua_pushboolean(L, 0);
791 return 1;
792 }
793 lua_rawgeti(L, -1, 2); // t(object) id
794 if (!lua_isnumber(L, -1))
795 {
796 lua_pushboolean(L, 0);
797 return 1;
798 }
799
800 // �ڶ�����м��
801 size_t id = (size_t)lua_tonumber(L, -1);
802 lua_pop(L, 1); // t(object)
803 if (!m_ObjectPool.Data(id))
804 {
805 lua_pushboolean(L, 0);
806 return 1;
807 }
808
809 GETOBJTABLE; // t(object) ot
810 lua_rawgeti(L, -1, (lua_Integer)(id + 1)); // t(object) ot t(object)
811 if (lua_rawequal(L, -1, -3))
812 lua_pushboolean(L, 1);
813 else
814 lua_pushboolean(L, 0);
815 return 1;
816}
817
818bool GameObjectPool::Angle(size_t idA, size_t idB, double& out)LNOEXCEPT
819{

Callers

nothing calls this directly

Calls 1

DataMethod · 0.80

Tested by

no test coverage detected