MCPcopy Create free account
hub / github.com/defold/defold / GetComponentIndex

Function GetComponentIndex

engine/gameobject/src/gameobject/gameobject.cpp:2187–2200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2185 }
2186
2187 Result GetComponentIndex(HInstance instance, dmhash_t component_id, uint16_t* component_index)
2188 {
2189 assert(instance != 0x0);
2190 for (uint32_t i = 0; i < instance->m_Prototype->m_ComponentCount; ++i)
2191 {
2192 Prototype::Component* component = &instance->m_Prototype->m_Components[i];
2193 if (component->m_Id == component_id)
2194 {
2195 *component_index = (uint16_t)i;
2196 return RESULT_OK;
2197 }
2198 }
2199 return RESULT_COMPONENT_NOT_FOUND;
2200 }
2201
2202 Result GetComponentId(HInstance instance, uint16_t component_index, dmhash_t* component_id)
2203 {

Callers 6

DispatchMessagesFunctionFunction · 0.85
GetPropertyFunction · 0.85
SetPropertyFunction · 0.85
TEST_FFunction · 0.85
TEST_FFunction · 0.85

Calls 1

assertFunction · 0.50

Tested by 2

TEST_FFunction · 0.68
TEST_FFunction · 0.68