本文整理汇总了C++中EHANDLE::Set方法的典型用法代码示例。如果您正苦于以下问题:C++ EHANDLE::Set方法的具体用法?C++ EHANDLE::Set怎么用?C++ EHANDLE::Set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EHANDLE
的用法示例。
在下文中一共展示了EHANDLE::Set方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UnlinkChild
//-----------------------------------------------------------------------------
// Purpose: Does the linked list work of removing a child object from the hierarchy.
// Input : pParent -
// pChild -
//-----------------------------------------------------------------------------
void UnlinkChild( CBaseEntity *pParent, CBaseEntity *pChild )
{
CBaseEntity *pList;
EHANDLE *pPrev;
pList = pParent->m_hMoveChild;
pPrev = &pParent->m_hMoveChild;
while ( pList )
{
CBaseEntity *pNext = pList->m_hMovePeer;
if ( pList == pChild )
{
// patch up the list
pPrev->Set( pNext );
// Clear hierarchy bits for this guy
pList->m_hMoveParent.Set( NULL );
pList->m_hMovePeer.Set( NULL );
pList->DispatchUpdateTransmitState();
pList->OnEntityEvent( ENTITY_EVENT_PARENT_CHANGED, NULL );
pParent->RecalcHasPlayerChildBit();
return;
}
else
{
pPrev = &pList->m_hMovePeer;
pList = pNext;
}
}
// This only happens if the child wasn't found in the parent's child list
Assert(0);
}
示例2: LinkChild
void LinkChild( CBaseEntity *pParent, CBaseEntity *pChild )
{
EHANDLE hParent;
hParent.Set( pParent );
pChild->m_hMovePeer.Set( pParent->FirstMoveChild() );
pParent->m_hMoveChild.Set( pChild );
pChild->m_hMoveParent = hParent;
pChild->NetworkProp()->SetNetworkParent( hParent );
pChild->DispatchUpdateTransmitState();
pChild->OnEntityEvent( ENTITY_EVENT_PARENT_CHANGED, NULL );
pParent->RecalcHasPlayerChildBit();
}