本文整理汇总了C++中CClientInfoMgr::IsLocalTeam方法的典型用法代码示例。如果您正苦于以下问题:C++ CClientInfoMgr::IsLocalTeam方法的具体用法?C++ CClientInfoMgr::IsLocalTeam怎么用?C++ CClientInfoMgr::IsLocalTeam使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CClientInfoMgr
的用法示例。
在下文中一共展示了CClientInfoMgr::IsLocalTeam方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Update
void CHUDScoreDiff::Update()
{
if (!IsMultiplayerGameClient()) return;
if (GameModeMgr::Instance( ).m_grbEliminationWin)
{
CClientInfoMgr *pCIMgr = g_pGameClientShell->GetInterfaceMgr( )->GetClientInfoMgr();
if (!pCIMgr) return;
CLIENT_INFO* pCI = pCIMgr->GetFirstClient();
int32 nEnemiesLeft = 0;
while (pCI)
{
if (pCI && pCI != g_pInterfaceMgr->GetClientInfoMgr()->GetLocalClient())
{
CCharacterFX* pCharacter = g_pGameClientShell->GetSFXMgr()->GetCharacterFromClientID(pCI->nID);
if (pCharacter && !pCharacter->IsPlayerDead() && !pCharacter->m_cs.bIsSpectating )
{
if (GameModeMgr::Instance( ).m_grbUseTeams)
{
if (!pCIMgr->IsLocalTeam(pCI->nTeamID))
{
++nEnemiesLeft;
}
}
else
{
++nEnemiesLeft;
}
}
}
pCI = pCI->pNext;
}
wchar_t wsScore[16] = L"";
FormatString("HUD_Score_Format",wsScore,LTARRAYSIZE(wsScore),nEnemiesLeft);
m_Text.SetText(wsScore);
m_Text.SetColor(m_cTextColor);
}
else
{
int32 nLocalScore = 0;
int32 nOtherScore = 0;
if (GameModeMgr::Instance( ).m_grbUseTeams)
{
uint8 nTeam = g_pInterfaceMgr->GetClientInfoMgr()->GetLocalTeam();
CTeam* pTeam = CTeamMgr::Instance().GetTeam(nTeam);
if (pTeam)
{
nLocalScore = pTeam->GetScore();
}
nTeam = 1-nTeam;
pTeam = CTeamMgr::Instance().GetTeam(nTeam);
if (pTeam)
{
nOtherScore = pTeam->GetScore();
}
}
else
{
CLIENT_INFO* pCI = g_pInterfaceMgr->GetClientInfoMgr()->GetLocalClient();
if (pCI)
{
nLocalScore = pCI->sScore.GetScore();
}
pCI = g_pInterfaceMgr->GetClientInfoMgr()->GetFirstClient();
if (pCI && pCI == g_pInterfaceMgr->GetClientInfoMgr()->GetLocalClient())
{
pCI = pCI->pNext;
}
if (pCI)
{
nOtherScore = pCI->sScore.GetScore();
}
}
wchar_t wsScore[16] = L"";
int32 nDiff = (nLocalScore-nOtherScore);
FormatString("HUD_Score_Format",wsScore,LTARRAYSIZE(wsScore),nDiff);
if (nDiff > 0)
{
m_Text.SetColor(m_cWinningTextColor);
FormatString("HUD_Score_Format_Advantage",wsScore,LTARRAYSIZE(wsScore),nDiff);
}
else if (nDiff == 0)
{
m_Text.SetColor(m_cTextColor);
}
else
{
m_Text.SetColor(m_cLosingTextColor);
}
m_Text.SetText(wsScore);
}
}