本文整理汇总了C++中CTeamControlPointMaster::GetControlPointName方法的典型用法代码示例。如果您正苦于以下问题:C++ CTeamControlPointMaster::GetControlPointName方法的具体用法?C++ CTeamControlPointMaster::GetControlPointName怎么用?C++ CTeamControlPointMaster::GetControlPointName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTeamControlPointMaster
的用法示例。
在下文中一共展示了CTeamControlPointMaster::GetControlPointName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FindControlPoints
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CTeamControlPointRound::FindControlPoints( void )
{
// Let out control point masters know that the round has started
CTeamControlPointMaster *pMaster = g_hControlPointMasters.Count() ? g_hControlPointMasters[0] : NULL;
if ( pMaster )
{
// go through all the points
CBaseEntity *pEnt = gEntList.FindEntityByClassname( NULL, pMaster->GetControlPointName() );
while( pEnt )
{
CTeamControlPoint *pPoint = assert_cast<CTeamControlPoint *>(pEnt);
if ( pPoint )
{
const char *pString = STRING( m_iszCPNames );
const char *pName = STRING( pPoint->GetEntityName() );
// HACK to work around a problem with cp_a being returned for an entity name with cp_A
const char *pos = Q_stristr( pString, pName );
if ( pos )
{
int len = Q_strlen( STRING( pPoint->GetEntityName() ) );
if ( *(pos + len) == ' ' || *(pos + len) == '\0' )
{
if( m_ControlPoints.Find( pPoint ) == m_ControlPoints.InvalidIndex() )
{
DevMsg( 2, "Adding control point %s to control point round %s\n", pPoint->GetEntityName().ToCStr(), GetEntityName().ToCStr() );
m_ControlPoints.AddToHead( pPoint );
}
}
}
}
pEnt = gEntList.FindEntityByClassname( pEnt, pMaster->GetControlPointName() );
}
}
if( m_ControlPoints.Count() == 0 )
{
Warning( "Error! No control points found in map for team_game_round %s!\n", GetEntityName().ToCStr() );
}
}