当前位置: 首页>>代码示例>>C++>>正文


C++ MovableObject::notifyAttached方法代码示例

本文整理汇总了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;

}
开发者ID:yamokosk,项目名称:sceneml,代码行数:27,代码来源:SceneNode.cpp

示例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 );
}
开发者ID:yamokosk,项目名称:sceneml,代码行数:13,代码来源:SceneNode.cpp

示例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();
}
开发者ID:yamokosk,项目名称:sceneml,代码行数:21,代码来源:SceneNode.cpp


注:本文中的MovableObject::notifyAttached方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。