Added the return of the index position of the added UserObject
This commit is contained in:
parent
71a961ccc3
commit
848ec5e770
@ -58,7 +58,7 @@ const Referenced* Object::getUserData() const
|
|||||||
return _userDataContainer.valid() ? _userDataContainer->_userData.get() : 0;
|
return _userDataContainer.valid() ? _userDataContainer->_userData.get() : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Object::addUserObject(Object* obj)
|
unsigned int Object::addUserObject(Object* obj)
|
||||||
{
|
{
|
||||||
// make sure the UserDataContainer exists
|
// make sure the UserDataContainer exists
|
||||||
getOrCreateUserDataContainer();
|
getOrCreateUserDataContainer();
|
||||||
@ -68,11 +68,15 @@ void Object::addUserObject(Object* obj)
|
|||||||
if (i<_userDataContainer->_objectList.size())
|
if (i<_userDataContainer->_objectList.size())
|
||||||
{
|
{
|
||||||
// object already in container so just return.
|
// object already in container so just return.
|
||||||
return;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned int pos = _userDataContainer->_objectList.size();
|
||||||
|
|
||||||
// object not already on user data container so add it in.
|
// object not already on user data container so add it in.
|
||||||
_userDataContainer->_objectList.push_back(obj);
|
_userDataContainer->_objectList.push_back(obj);
|
||||||
|
|
||||||
|
return pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Object::removeUserObject(unsigned int i)
|
void Object::removeUserObject(unsigned int i)
|
||||||
|
Loading…
Reference in New Issue
Block a user