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

Function FindPropertyName

engine/gameobject/src/gameobject/comp_script.cpp:880–947  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

878 }
879
880 static bool FindPropertyName(dmPropertiesDDF::PropertyDeclarations* decls, dmhash_t property_id, const char** out_key, PropertyType* out_type, dmhash_t** out_element_ids, bool* out_is_element, uint32_t* out_element_index)
881 {
882 *out_is_element = false;
883 if (FindPropertyNameFromEntries(decls->m_BoolEntries.m_Data, decls->m_BoolEntries.m_Count,
884 property_id, out_key, out_element_ids))
885 {
886 *out_type = PROPERTY_TYPE_BOOLEAN;
887 return true;
888 }
889 if (FindPropertyNameFromEntries(decls->m_NumberEntries.m_Data, decls->m_NumberEntries.m_Count,
890 property_id, out_key, out_element_ids))
891 {
892 *out_type = PROPERTY_TYPE_NUMBER;
893 return true;
894 }
895 if (FindPropertyNameFromEntries(decls->m_HashEntries.m_Data, decls->m_HashEntries.m_Count,
896 property_id, out_key, out_element_ids))
897 {
898 *out_type = PROPERTY_TYPE_HASH;
899 return true;
900 }
901 if (FindPropertyNameFromEntries(decls->m_UrlEntries.m_Data, decls->m_UrlEntries.m_Count,
902 property_id, out_key, out_element_ids))
903 {
904 *out_type = PROPERTY_TYPE_URL;
905 return true;
906 }
907 if (FindPropertyNameFromEntries(decls->m_Vector3Entries.m_Data, decls->m_Vector3Entries.m_Count,
908 property_id, out_key, out_element_ids))
909 {
910 *out_type = PROPERTY_TYPE_VECTOR3;
911 return true;
912 }
913 if (FindPropertyNameFromElements(decls->m_Vector3Entries.m_Data, decls->m_Vector3Entries.m_Count,
914 property_id, out_key, out_element_index))
915 {
916 *out_type = PROPERTY_TYPE_NUMBER;
917 *out_is_element = true;
918 return true;
919 }
920 if (FindPropertyNameFromEntries(decls->m_Vector4Entries.m_Data, decls->m_Vector4Entries.m_Count,
921 property_id, out_key, out_element_ids))
922 {
923 *out_type = PROPERTY_TYPE_VECTOR4;
924 return true;
925 }
926 if (FindPropertyNameFromElements(decls->m_Vector4Entries.m_Data, decls->m_Vector4Entries.m_Count,
927 property_id, out_key, out_element_index))
928 {
929 *out_type = PROPERTY_TYPE_NUMBER;
930 *out_is_element = true;
931 return true;
932 }
933 if (FindPropertyNameFromEntries(decls->m_QuatEntries.m_Data, decls->m_QuatEntries.m_Count,
934 property_id, out_key, out_element_ids))
935 {
936 *out_type = PROPERTY_TYPE_QUAT;
937 return true;

Callers 2

CompScriptGetPropertyFunction · 0.85
CompScriptSetPropertyFunction · 0.85

Calls 2

Tested by

no test coverage detected