本文整理汇总了C++中MovableObject::notifyAttached方法的典型用法代码示例。如果您正苦于以下问题:C++ MovableObject::notifyAttached方法的具体用法?C++ MovableObject::notifyAttached怎么用?C++ MovableObject::notifyAttached使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MovableObject
的用法示例。
在下文中一共展示了MovableObject::notifyAttached方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: detachObject
MovableObject* SceneNode::detachObject(unsigned short index)
{
MovableObject* ret;
if (index < sceneObjects_.size())
{
ObjectMap::iterator i = sceneObjects_.begin();
// Increment (must do this one at a time)
while (index--)++i;
ret = i->second;
sceneObjects_.erase(i);
ret->notifyAttached((SceneNode*)0);
// Make sure bounds get updated (must go right to the top)
notifyUpdate( BoundsChangedBit );
return ret;
}
else
{
SML_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "Object index out of bounds.");
}
return 0;
}
示例2: detachAllObjects
void SceneNode::detachAllObjects(void)
{
ObjectMap::iterator itr;
MovableObject* ret;
for ( itr = sceneObjects_.begin(); itr != sceneObjects_.end(); itr++ )
{
ret = itr->second;
ret->notifyAttached((SceneNode*)0);
}
sceneObjects_.clear();
// Make sure bounds get updated (must go right to the top)
notifyUpdate( BoundsChangedBit );
}
示例3:
SceneNode::~SceneNode()
{
removeAllChildren();
if (parent_)
parent_->removeChild(this);
// Remove ourselves from the update queue
//dequeueForUpdate(this);
// Detach all objects, do this manually to avoid needUpdate() call
// which can fail because of deleted items
ObjectMap::iterator itr;
MovableObject* ret;
for ( itr = sceneObjects_.begin(); itr != sceneObjects_.end(); ++itr )
{
ret = itr->second;
ret->notifyAttached((SceneNode*)0);
}
sceneObjects_.clear();
}