本文整理汇总了C++中CElement::GetTypeName方法的典型用法代码示例。如果您正苦于以下问题:C++ CElement::GetTypeName方法的具体用法?C++ CElement::GetTypeName怎么用?C++ CElement::GetTypeName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CElement
的用法示例。
在下文中一共展示了CElement::GetTypeName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _GetEntitiesFromRoot
void CElement::_GetEntitiesFromRoot(unsigned int uiTypeHash, std::map<CElement*, int>& mapResults)
{
t_mapEntitiesFromRoot::iterator find = ms_mapEntitiesFromRoot.find(uiTypeHash);
if (find != ms_mapEntitiesFromRoot.end())
{
CChildListType& listEntities = find->second;
CElement* pEntity;
unsigned int uiIndex = 0;
for (CChildListType::const_reverse_iterator i = listEntities.rbegin(); i != listEntities.rend(); ++i)
{
pEntity = *i;
assert(pEntity);
ElementID ID = pEntity->GetID();
assert(ID != INVALID_ELEMENT_ID);
assert(pEntity == CElementIDs::GetElement(ID));
if (pEntity->IsBeingDeleted())
OutputDebugString(SString("Server: 0x%08x %s is flagged as IsBeingDeleted() but is still in GetEntitiesFromRoot\n", pEntity,
pEntity->GetTypeName().c_str()));
assert(mapResults.find(pEntity) == mapResults.end());
mapResults[pEntity] = 1;
}
}
}
示例2: BroadcastElementChildren
void CMapManager::BroadcastElementChildren ( CElement* pElement, CEntityAddPacket &Packet, list < CPerPlayerEntity* > &pPerPlayerList, bool bBroadcastAll )
{
CElement * pTemp;
CChildListType ::const_iterator iter = pElement->IterBegin ();
for ( ; iter != pElement->IterEnd(); iter++ )
{
pTemp = *iter;
// Is this a map created entity or our resource's root element
if ( bBroadcastAll || ( pTemp->IsMapCreated () || ( pTemp->GetType () == CElement::DUMMY && !strcmp ( pTemp->GetTypeName ().c_str (), "map" ) ) ) )
{
// Is it a per-player entity
if ( pTemp->IsPerPlayerEntity () )
{
pPerPlayerList.push_back ( static_cast < CPerPlayerEntity* > ( pTemp ) );
}
else
{
Packet.Add ( pTemp );
}
}
if ( pTemp->CountChildren() > 0 ) BroadcastElementChildren ( pTemp, Packet, pPerPlayerList, bBroadcastAll );
}
}