本文整理汇总了C++中CASW_Marine_Resource::GetHealthPercent方法的典型用法代码示例。如果您正苦于以下问题:C++ CASW_Marine_Resource::GetHealthPercent方法的具体用法?C++ CASW_Marine_Resource::GetHealthPercent怎么用?C++ CASW_Marine_Resource::GetHealthPercent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CASW_Marine_Resource
的用法示例。
在下文中一共展示了CASW_Marine_Resource::GetHealthPercent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AllMarinesDead
bool CASW_Mission_Manager::AllMarinesDead()
{
if (!ASWGameRules() || !ASWGameResource())
return false;
// can't be all dead if we haven't left briefing yet!
if (ASWGameRules()->GetGameState() < ASW_GS_INGAME)
return false;
int iMax = ASWGameResource()->GetMaxMarineResources();
for (int i=0;i<iMax;i++)
{
CASW_Marine_Resource *pMarineResource = ASWGameResource()->GetMarineResource(i);
if (pMarineResource && pMarineResource->GetHealthPercent() > 0)
{
return false; // we have a live marine, so they're not all dead
}
}
return true; // arg all dead!
}
示例2: CountAllAliveMarines
int CASW_Game_Resource::CountAllAliveMarines( void )
{
int m = GetMaxMarineResources();
int iMarines = 0;
for ( int i = 0; i < m; i++ )
{
CASW_Marine_Resource *pMR = GetMarineResource( i );
if ( !pMR )
continue;
CASW_Marine *pMarine = pMR->GetMarineEntity();
if ( !pMarine )
continue;
if ( pMR->GetHealthPercent() > 0 )
{
iMarines++;
}
}
return iMarines;
}