本文整理汇总了C++中C_BaseObject::GetBuilder方法的典型用法代码示例。如果您正苦于以下问题:C++ C_BaseObject::GetBuilder方法的具体用法?C++ C_BaseObject::GetBuilder怎么用?C++ C_BaseObject::GetBuilder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类C_BaseObject
的用法示例。
在下文中一共展示了C_BaseObject::GetBuilder方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateID
//.........这里部分代码省略.........
else
{
flHealth = (float)pPlayer->GetHealth();
}
}
else
{
bShowHealth = false;
}
}
if ( printFormatString )
{
wchar_t *pszPrepend = GetPrepend();
if ( !pszPrepend || !pszPrepend[0] )
{
pszPrepend = L"";
}
g_pVGuiLocalize->ConstructString( sIDString, sizeof(sIDString), g_pVGuiLocalize->Find(printFormatString), 2, pszPrepend, wszPlayerName );
}
}
else
{
// see if it is an object
if ( pEnt->IsBaseObject() )
{
C_BaseObject *pObj = assert_cast<C_BaseObject *>( pEnt );
pObj->GetTargetIDString( sIDString, sizeof(sIDString) );
pObj->GetTargetIDDataString( sDataString, sizeof(sDataString) );
bShowHealth = true;
flHealth = pObj->GetHealth();
flMaxHealth = pObj->GetMaxHealth();
C_TFPlayer *pBuilder = pObj->GetBuilder();
iColorNum = pBuilder ? pBuilder->GetTeamNumber() : pObj->GetTeamNumber();
}
else if ( pEnt->IsNPC() )
{
C_AI_BaseNPC *pNPC = assert_cast<C_AI_BaseNPC *>( pEnt );
pNPC->GetTargetIDString( sIDString, sizeof(sIDString) );
pNPC->GetTargetIDDataString( sDataString, sizeof(sDataString) );
bShowHealth = true;
flHealth = pNPC->GetHealth();
flMaxHealth = pNPC->GetMaxHealth();
iMaxBuffedHealth = pNPC->GetMaxBuffedHealth();
iColorNum = pNPC->GetTeamNumber();
}
}
// Setup health icon
if ( !pEnt->IsAlive() )
{
flHealth = 0; // fixup for health being 1 when dead
}
SetColorForTargetTeam( iColorNum );
m_pTargetHealth->SetHealth( flHealth, flMaxHealth, iMaxBuffedHealth );
m_pTargetHealth->SetVisible( bShowHealth );
int iNameW, iDataW, iIgnored;
m_pTargetNameLabel->GetContentSize( iNameW, iIgnored );
m_pTargetDataLabel->GetContentSize( iDataW, iIgnored );
// Target name