本文整理汇总了C++中CASW_Player::IsPrimaryMarine方法的典型用法代码示例。如果您正苦于以下问题:C++ CASW_Player::IsPrimaryMarine方法的具体用法?C++ CASW_Player::IsPrimaryMarine怎么用?C++ CASW_Player::IsPrimaryMarine使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CASW_Player
的用法示例。
在下文中一共展示了CASW_Player::IsPrimaryMarine方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateLastCommanders
void CASW_Campaign_Save::UpdateLastCommanders()
{
// save which marines the players have selected
// add which marines he has selected
CASW_Game_Resource *pGameResource = ASWGameResource();
if ( !pGameResource )
return;
// first check there were some marines selected (i.e. we're not in the campaign lobby map)
int iNumMarineResources = 0;
for (int i=0;i<pGameResource->GetMaxMarineResources();i++)
{
if (pGameResource->GetMarineResource(i))
iNumMarineResources++;
}
if ( iNumMarineResources <= 0 )
return;
char buffer[256];
for (int i=0;i<ASW_NUM_MARINE_PROFILES;i++)
{
// look for a marine info for this marine
bool bFound = false;
for (int k=0;k<pGameResource->GetMaxMarineResources();k++)
{
CASW_Marine_Resource *pMR = pGameResource->GetMarineResource(k);
if (pMR && pMR->GetProfileIndex() == i && pMR->GetCommander())
{
CASW_Player *pPlayer = pMR->GetCommander();
if (pPlayer)
{
// store the commander who has this marine
Q_snprintf(buffer, sizeof(buffer), "%s%s",pPlayer->GetPlayerName(), pPlayer->GetASWNetworkID());
m_LastCommanders[i] = AllocPooledString(buffer);
m_LastMarineResourceSlot[i] = k;
m_LastPrimaryMarines[i] = pPlayer->IsPrimaryMarine(i);
bFound = true;
break;
}
}
}
if (!bFound)
{
m_LastCommanders[i] = AllocPooledString("");
m_LastMarineResourceSlot[i] = 0;
}
}
}