| 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 | { |