本文整理汇总了C++中CGlobalEntityList::FindEntityByClassnameWithin方法的典型用法代码示例。如果您正苦于以下问题:C++ CGlobalEntityList::FindEntityByClassnameWithin方法的具体用法?C++ CGlobalEntityList::FindEntityByClassnameWithin怎么用?C++ CGlobalEntityList::FindEntityByClassnameWithin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGlobalEntityList
的用法示例。
在下文中一共展示了CGlobalEntityList::FindEntityByClassnameWithin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
//-----------------------------------------------------------------------------
// Purpose: Finds the first entity by target name or class name within a radius
// Input : pStartEntity - The entity to start from when doing the search.
// szName - Entity name to search for. Treated as a target name first,
// then as an entity class name, ie "info_target".
// vecSrc - Center of search radius.
// flRadius - Search radius for classname search, 0 to search everywhere.
// pSearchingEntity - The entity that is doing the search.
// pActivator - The activator entity if this was called from an input
// or Use handler, NULL otherwise.
// Output : Returns a pointer to the found entity, NULL if none.
//-----------------------------------------------------------------------------
CBaseEntity *CGlobalEntityList::FindEntityGenericWithin( CBaseEntity *pStartEntity, const char *szName, const Vector &vecSrc, float flRadius, CBaseEntity *pSearchingEntity, CBaseEntity *pActivator, CBaseEntity *pCaller )
{
CBaseEntity *pEntity = NULL;
pEntity = gEntList.FindEntityByNameWithin( pStartEntity, szName, vecSrc, flRadius, pSearchingEntity, pActivator, pCaller );
if (!pEntity)
{
pEntity = gEntList.FindEntityByClassnameWithin( pStartEntity, szName, vecSrc, flRadius );
}
return pEntity;
}