本文整理汇总了C++中CBaseEntity::GetDebugName方法的典型用法代码示例。如果您正苦于以下问题:C++ CBaseEntity::GetDebugName方法的具体用法?C++ CBaseEntity::GetDebugName怎么用?C++ CBaseEntity::GetDebugName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBaseEntity
的用法示例。
在下文中一共展示了CBaseEntity::GetDebugName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InputTeleport
//------------------------------------------------------------------------------
// Purpose:
//------------------------------------------------------------------------------
void CPointTeleport::InputTeleport( inputdata_t &inputdata )
{
// Attempt to find the entity in question
CBaseEntity *pTarget = gEntList.FindEntityByName( NULL, m_target, this, inputdata.pActivator, inputdata.pCaller );
if ( pTarget == NULL )
return;
// If teleport object is in a movement hierarchy, remove it first
if ( EntityMayTeleport( pTarget ) == false )
{
Warning("ERROR: (%s) can't teleport object (%s) as it has a parent (%s)!\n",GetDebugName(),pTarget->GetDebugName(),pTarget->GetMoveParent()->GetDebugName());
return;
}
pTarget->Teleport( &m_vSaveOrigin, &m_vSaveAngles, NULL );
}
示例2: Activate
//------------------------------------------------------------------------------
// Purpose:
//------------------------------------------------------------------------------
void CPointTeleport::Activate( void )
{
m_vSaveOrigin = GetAbsOrigin();
m_vSaveAngles = GetAbsAngles();
CBaseEntity *pTarget = GetNextTarget();
if (pTarget)
{
if ( pTarget->GetMoveParent() != NULL )
{
Warning("ERROR: (%s) can't teleport object (%s) as it has a parent!\n",GetDebugName(),pTarget->GetDebugName());
BaseClass::Activate();
return;
}
if (m_spawnflags & SF_TELEPORT_TO_SPAWN_POS)
{
m_vSaveOrigin = pTarget->GetAbsOrigin();
m_vSaveAngles = pTarget->GetAbsAngles();
}
}
else if (m_spawnflags & SF_TELEPORT_TO_SPAWN_POS)
{
Warning("ERROR: (%s) target '%s' not found. Deleting.\n", GetDebugName(), STRING(m_target));
UTIL_Remove(this);
return;
}
BaseClass::Activate();
}
示例3: InputTeleport
//------------------------------------------------------------------------------
// Purpose:
//------------------------------------------------------------------------------
void CPointTeleport::InputTeleport( inputdata_t &inputdata )
{
CBaseEntity *pTarget = GetNextTarget();
if (pTarget)
{
// If teleport object is in a movement hierarchy, remove it first
if ( pTarget->GetMoveParent() != NULL )
{
Warning("ERROR: (%s) can't teleport object (%s) as it has a parent (%s)!\n",GetDebugName(),pTarget->GetDebugName(),pTarget->GetMoveParent()->GetDebugName());
return;
}
pTarget->Teleport( &m_vSaveOrigin, &m_vSaveAngles, NULL );
}
}
示例4: FrameUpdatePostEntityThink
//---------------------------------------------------------
// Purpose: See if it is time to poll and do so.
//
// SOON: We need to load-balance this.
//---------------------------------------------------------
void CVisibilityMonitor::FrameUpdatePostEntityThink()
{
if( gpGlobals->curtime < m_flTimeNextPoll )
return;
m_flTimeNextPoll = gpGlobals->curtime + vismon_poll_frequency.GetFloat();
int iDebugging = debug_visibility_monitor.GetInt();
if( m_Entities.Count() > m_iMaxEntitiesPerThink )
m_iMaxEntitiesPerThink = m_Entities.Count();
if( iDebugging > 1 )
{
Msg("\nVisMon: Polling now. (Frequency: %f)\n", m_flPollFrequency );
Msg("VisMon: Time: %f - Tracking %d Entities. (Max:%d)\n", gpGlobals->curtime, m_Entities.Count(), m_iMaxEntitiesPerThink );
}
// Cleanup, dump entities that have been removed since we last polled.
for ( int i = 0 ; i < m_Entities.Count() ; i++ )
{
if ( m_Entities[i].entity == NULL )
{
m_Entities.FastRemove(i);
if ( i >= m_Entities.Count() )
{
break;
}
}
}
int numTraces = 0;
bool bHitTraceLimit = false;
if( m_iStartElement >= m_Entities.Count() )
{
if( iDebugging > 1 )
{
Msg("VisMon: RESET\n");
}
m_iStartElement = 0;
}
if( iDebugging > 1 )
{
Msg("VisMon: Starting at element: %d\n", m_iStartElement );
}
for( int i = m_iStartElement ; i < m_Entities.Count() ; i++ )
{
for( int j = 1 ; j <= gpGlobals->maxClients ; j++ )
{
CBasePlayer *pPlayer =UTIL_PlayerByIndex( j );
if( pPlayer != NULL && pPlayer->IsAlive() && !pPlayer->IsBot() )
{
int memoryBit = 1 << j; // The bit that is used to remember whether a given entity has been seen by a given player.
CBaseEntity *pSeeEntity = m_Entities[ i ].entity.Get();
if( pSeeEntity == NULL )
{
continue;
}
if( !(m_Entities[i].memory & memoryBit) )
{
// If this player hasn't seen this entity yet, check it.
if( EntityIsVisibleToPlayer( m_Entities[i], pPlayer, &numTraces ) )
{
bool bIgnore = false;
if( m_Entities[i].pfnEvaluator != NULL && !m_Entities[i].pfnEvaluator( m_Entities[i].entity, pPlayer ) )
{
bIgnore = true;
}
// See it! Generate our event.
if( iDebugging > 0 )
{
if( bIgnore )
{
Msg("VisMon: Player %s IGNORING VISIBILE Entity: %s\n", pPlayer->GetDebugName(), pSeeEntity->GetDebugName() );
NDebugOverlay::Cross3D( pSeeEntity->WorldSpaceCenter(), 16, 255, 0, 0, false, 10.0f );
}
else
{
Msg("VisMon: Player %s sees Entity: %s\n", pPlayer->GetDebugName(), pSeeEntity->GetDebugName() );
NDebugOverlay::Cross3D( pSeeEntity->WorldSpaceCenter(), 16, 0, 255, 0, false, 10.0f );
}
}
if( !bIgnore )
{
//.........这里部分代码省略.........