本文整理汇总了C++中string_t::ToCStr方法的典型用法代码示例。如果您正苦于以下问题:C++ string_t::ToCStr方法的具体用法?C++ string_t::ToCStr怎么用?C++ string_t::ToCStr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类string_t
的用法示例。
在下文中一共展示了string_t::ToCStr方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InputUnlock
void CPointBonusMapsAccessor::InputUnlock( inputdata_t& inputdata )
{
#if 0
if ( m_pGameUI )
{
m_pGameUI->BonusMapUnlock( m_String_tFileName.ToCStr(), m_String_tMapName.ToCStr() );
}
#endif
}
示例2: PanicThink
//-----------------------------------------------------------------------------
// Purpose: Play panic vo and animations, then return to talking
// Output :
//-----------------------------------------------------------------------------
void CPropGladosCore::PanicThink ( void )
{
if ( m_speechEvents.Count() <= 0 || !m_speechEvents.IsValidIndex( m_iSpeechIter ) || m_iszPanicSoundScriptName == NULL_STRING )
{
SetThink ( NULL );
SetNextThink( gpGlobals->curtime );
return;
}
StopSound( m_speechEvents[m_iSpeechIter].ToCStr() );
EmitSound( m_iszPanicSoundScriptName.ToCStr() );
float flCurDuration = GetSoundDuration( m_iszPanicSoundScriptName.ToCStr(), GLADOS_CORE_MODEL_NAME );
SetThink( &CPropGladosCore::TalkingThink );
SetNextThink( gpGlobals->curtime + m_flBetweenVOPadding + flCurDuration );
}
示例3: InputComplete
void CPointBonusMapsAccessor::InputComplete( inputdata_t& inputdata )
{
if ( m_pGameUI )
{
m_pGameUI->BonusMapComplete( m_String_tFileName.ToCStr(), m_String_tMapName.ToCStr() );
int iNumAdvancedComplete = m_pGameUI->BonusMapNumAdvancedCompleted();
IGameEvent *event = gameeventmanager->CreateEvent( "advanced_map_complete" );
if ( event )
{
event->SetInt( "numadvanced", iNumAdvancedComplete );
gameeventmanager->FireEvent( event );
}
}
}
示例4: InputGenerateEvent
//-----------------------------------------------------------------------------
// Purpose: Input handler for showing the message and/or playing the sound.
//-----------------------------------------------------------------------------
void CPointEventProxy::InputGenerateEvent( inputdata_t &inputdata )
{
IGameEvent * event = gameeventmanager->CreateEvent( m_iszEventName.ToCStr() );
if ( event )
{
CBasePlayer *pActivator = NULL;
#ifdef INFESTED_DLL
CASW_Marine *pMarine = dynamic_cast< CASW_Marine* >( inputdata.pActivator );
if ( pMarine )
{
pActivator = pMarine->GetCommander();
}
#else
pActivator = dynamic_cast< CBasePlayer* >( inputdata.pActivator );
#endif
if ( m_bActivatorAsUserID )
{
event->SetInt( "userid", ( pActivator ? pActivator->GetUserID() : 0 ) );
}
gameeventmanager->FireEvent( event );
}
}
示例5: FindTarget
void CTFOClassnameFinder::FindTarget( inputdata_t &inputdata )
{
bool bFound = false;
CBaseEntity *pMyFoundEnt = NULL;
// Try classname
pMyFoundEnt = gEntList.FindEntityByClassname( NULL, szTarget.ToCStr() );
while ( pMyFoundEnt )
{
if ( !strcmp( pMyFoundEnt->GetClassname(), szTarget.ToCStr() ) )
{
pFoundTarget.FireOutput( this, this );
bFound = true;
break;
}
pMyFoundEnt = gEntList.FindEntityByClassname( pMyFoundEnt, szTarget.ToCStr() );
}
if ( bFound )
return;
// Try the actual name
pMyFoundEnt = gEntList.FindEntityByName( NULL, szTarget.ToCStr() );
while ( pMyFoundEnt )
{
if ( !strcmp( pMyFoundEnt->GetEntityName().ToCStr(), szTarget.ToCStr() ) )
{
pFoundTarget.FireOutput( this, this );
break;
}
pMyFoundEnt = gEntList.FindEntityByName( pMyFoundEnt, szTarget.ToCStr() );
}
}
示例6: InputGenerateGameEvent
//---------------------------------------------------------
//---------------------------------------------------------
void CInfoGameEventProxy::InputGenerateGameEvent( inputdata_t &inputdata )
{
CBasePlayer *pActivator = ToBasePlayer( inputdata.pActivator );
IGameEvent *event = gameeventmanager->CreateEvent( m_iszEventName.ToCStr() );
if ( event )
{
if ( pActivator )
{
event->SetInt( "userid", pActivator->GetUserID() );
}
event->SetInt( "subject", entindex() );
gameeventmanager->FireEvent( event );
}
}
示例7: GetAlienBounds
bool CASW_Spawn_Manager::GetAlienBounds( string_t iszAlienClass, Vector &vecMins, Vector &vecMaxs )
{
int nCount = GetNumAlienClasses();
for ( int i = 0 ; i < nCount; i++ )
{
if ( iszAlienClass == GetAlienClass( i )->m_iszAlienClass )
{
vecMins = NAI_Hull::Mins( GetAlienClass( i )->m_nHullType );
vecMaxs = NAI_Hull::Maxs (GetAlienClass( i )->m_nHullType );
return true;
}
}
if (strcmp(iszAlienClass.ToCStr(), "asw_drone_uber") == 0) {
vecMins = NAI_Hull::Mins( HULL_MEDIUMBIG );
vecMaxs = NAI_Hull::Maxs( HULL_MEDIUMBIG );
return true;
}
return false;
}
示例8: InputShowHint
//-----------------------------------------------------------------------------
// Purpose: Input handler for showing the message and/or playing the sound.
//-----------------------------------------------------------------------------
void CEnvInstructorHint::InputShowHint( inputdata_t &inputdata )
{
static int s_InstructorServerHintEventCreate = 0;
IGameEvent * event = gameeventmanager->CreateEvent( "instructor_server_hint_create", false, &s_InstructorServerHintEventCreate );
if ( event )
{
CBaseEntity *pTargetEntity = gEntList.FindEntityByName( NULL, m_iszHintTargetEntity );
if( pTargetEntity == NULL && !m_bStatic )
pTargetEntity = inputdata.pActivator;
if( pTargetEntity == NULL )
pTargetEntity = GetWorldEntity();
char szColorString[128];
Q_snprintf( szColorString, sizeof( szColorString ), "%.3d,%.3d,%.3d", m_Color.r, m_Color.g, m_Color.b );
int iFlags = 0;
iFlags |= (m_iPulseOption == 0) ? 0 : (LOCATOR_ICON_FX_PULSE_SLOW << (m_iPulseOption - 1));
iFlags |= (m_iAlphaOption == 0) ? 0 : (LOCATOR_ICON_FX_ALPHA_SLOW << (m_iAlphaOption - 1));
iFlags |= (m_iShakeOption == 0) ? 0 : (LOCATOR_ICON_FX_SHAKE_NARROW << (m_iShakeOption - 1));
iFlags |= m_bStatic ? LOCATOR_ICON_FX_STATIC : 0;
CBasePlayer *pActivator = NULL;
bool bFilterByActivator = m_bLocalPlayerOnly;
#ifdef INFESTED_DLL
CASW_Marine *pMarine = dynamic_cast<CASW_Marine*>( inputdata.pActivator );
if ( pMarine )
{
pActivator = pMarine->GetCommander();
}
#else
if ( inputdata.value.StringID() != NULL_STRING )
{
CBaseEntity *pTarget = gEntList.FindEntityByName( NULL, inputdata.value.String() );
pActivator = dynamic_cast<CBasePlayer*>( pTarget );
if ( pActivator )
{
bFilterByActivator = true;
}
}
else
{
if ( GameRules()->IsMultiplayer() == false )
{
pActivator = UTIL_GetLocalPlayer();
}
else
{
Warning( "Failed to play server side instructor hint: no player specified for hint\n" );
Assert( 0 );
}
}
#endif
const char *pActivatorCaption = m_iszActivatorCaption.ToCStr();
if ( !pActivatorCaption || pActivatorCaption[ 0 ] == '\0' )
{
pActivatorCaption = m_iszCaption.ToCStr();
}
event->SetString( "hint_name", GetEntityName().ToCStr() );
event->SetString( "hint_replace_key", m_iszReplace_Key.ToCStr() );
event->SetInt( "hint_target", pTargetEntity->entindex() );
event->SetInt( "hint_activator_userid", ( pActivator ? pActivator->GetUserID() : 0 ) );
event->SetInt( "hint_timeout", m_iTimeout );
event->SetString( "hint_icon_onscreen", m_iszIcon_Onscreen.ToCStr() );
event->SetString( "hint_icon_offscreen", m_iszIcon_Offscreen.ToCStr() );
event->SetString( "hint_caption", m_iszCaption.ToCStr() );
event->SetString( "hint_activator_caption", pActivatorCaption );
event->SetString( "hint_color", szColorString );
event->SetFloat( "hint_icon_offset", m_fIconOffset );
event->SetFloat( "hint_range", m_fRange );
event->SetInt( "hint_flags", iFlags );
event->SetString( "hint_binding", m_iszBinding.ToCStr() );
event->SetBool( "hint_allow_nodraw_target", m_bAllowNoDrawTarget );
event->SetBool( "hint_nooffscreen", m_bNoOffscreen );
event->SetBool( "hint_forcecaption", m_bForceCaption );
event->SetBool( "hint_local_player_only", bFilterByActivator );
gameeventmanager->FireEvent( event );
}
}