本文整理汇总了C++中C4PlayerInfo::IsUsingTeam方法的典型用法代码示例。如果您正苦于以下问题:C++ C4PlayerInfo::IsUsingTeam方法的具体用法?C++ C4PlayerInfo::IsUsingTeam怎么用?C++ C4PlayerInfo::IsUsingTeam使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类C4PlayerInfo
的用法示例。
在下文中一共展示了C4PlayerInfo::IsUsingTeam方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void C4Team::RecheckPlayers()
{
// check all players within the team
for (int32_t i=0; i<iPlayerCount; ++i)
{
bool fIsValid = false; int32_t id; C4PlayerInfo *pInfo;
if ((id = piPlayers[i]))
if ((pInfo = Game.PlayerInfos.GetPlayerInfoByID(id)))
if (pInfo->GetTeam() == GetID())
if (pInfo->IsUsingTeam())
fIsValid = true;
// removal will decrease iPlayerCount, which will abort the loop earlier
if (!fIsValid) RemoveIndexedPlayer(i--);
}
// now check for any new players in the team
int32_t id = 0; C4PlayerInfo *pInfo;
while ((pInfo = Game.PlayerInfos.GetNextPlayerInfoByID(id)))
{
id = pInfo->GetID();
if (pInfo->GetTeam() == GetID())
if (pInfo->IsUsingTeam())
if (!IsPlayerIDInTeam(id))
AddPlayer(*pInfo, false);
}
}