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


C++ CElement::GetTypeName方法代码示例

本文整理汇总了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;
        }
    }
}
开发者ID:Necktrox,项目名称:mtasa-blue,代码行数:26,代码来源:CElement.cpp

示例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 );
    }
}
开发者ID:EagleShen,项目名称:MTA,代码行数:23,代码来源:CMapManager.cpp


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