mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 08:04:40 +00:00
Merge pull request #1178 from Azaezel/alpha41/arrayObjectAugs
arrayobject helper commands
This commit is contained in:
commit
810c070512
1 changed files with 16 additions and 0 deletions
|
|
@ -600,6 +600,22 @@ DefineEngineMethod( ArrayObject, getIndexFromKey, S32, ( const char* key ),,
|
||||||
return object->getIndexFromKey( key );
|
return object->getIndexFromKey( key );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DefineEngineMethod(ArrayObject, getValueFromKey, const char*, (const char* key), ,
|
||||||
|
"Search the array from the current position for the Key "
|
||||||
|
"@param value Array key to search for\n"
|
||||||
|
"@return Value of the first element found, or -1 if none\n")
|
||||||
|
{
|
||||||
|
return object->getValueFromIndex(object->getIndexFromKey(key)).c_str();
|
||||||
|
}
|
||||||
|
|
||||||
|
DefineEngineMethod(ArrayObject, getKeyFromValue, const char*, (const char* key), ,
|
||||||
|
"Search the array from the current position for the Value "
|
||||||
|
"@param value Array key to search for\n"
|
||||||
|
"@return Key of the first element found, or -1 if none\n")
|
||||||
|
{
|
||||||
|
return object->getKeyFromIndex(object->getIndexFromValue(key)).c_str();
|
||||||
|
}
|
||||||
|
|
||||||
DefineEngineMethod( ArrayObject, getValue, const char*, ( S32 index ),,
|
DefineEngineMethod( ArrayObject, getValue, const char*, ( S32 index ),,
|
||||||
"Get the value of the array element at the submitted index.\n"
|
"Get the value of the array element at the submitted index.\n"
|
||||||
"@param index 0-based index of the array element to get\n"
|
"@param index 0-based index of the array element to get\n"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue