本文整理汇总了C++中House::getNumDestroyedStructures方法的典型用法代码示例。如果您正苦于以下问题:C++ House::getNumDestroyedStructures方法的具体用法?C++ House::getNumDestroyedStructures怎么用?C++ House::getNumDestroyedStructures使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类House
的用法示例。
在下文中一共展示了House::getNumDestroyedStructures方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: calculateScore
void GameStatsMenu::calculateScore(int level)
{
Human_UnitsDestroyed = 0;
AI_UnitsDestroyed = 0;
Human_StructuresDestroyed = 0;
AI_StructuresDestroyed = 0;
Human_SpiceHarvested = 0.0;
AI_SpiceHarvested = 0.0;
totalTime = currentGame->GetGameTime()/1000;
totalScore = level*45;
double totalHumanCredits = 0.0;
for(int i=0; i < MAX_PLAYERS; i++) {
House* pHouse = currentGame->house[i];
if(pHouse != NULL) {
if(pHouse->isAI() == true) {
AI_UnitsDestroyed += pHouse->getNumDestroyedUnits();
AI_StructuresDestroyed += pHouse->getNumDestroyedStructures();
AI_SpiceHarvested += pHouse->getHarvestedSpice();
totalScore -= pHouse->getDestroyedValue();
} else {
Human_UnitsDestroyed += pHouse->getNumDestroyedUnits();
Human_StructuresDestroyed += pHouse->getNumDestroyedStructures();
Human_SpiceHarvested += pHouse->getHarvestedSpice();
totalHumanCredits += pHouse->getCredits();
totalScore += pHouse->getDestroyedValue();
}
}
}
totalScore += ((int) totalHumanCredits) / 100;
for(RobustList<StructureClass*>::const_iterator iter = structureList.begin(); iter != structureList.end(); ++iter) {
StructureClass* pStructure = *iter;
if(pStructure->getOwner()->isAI() == false) {
totalScore += currentGame->objectData.data[pStructure->getItemID()].price / 100;
}
}
totalScore -= ((totalTime/60) + 1);
for(RobustList<UnitClass*>::const_iterator iter = unitList.begin(); iter != unitList.end(); ++iter) {
UnitClass* pUnit = *iter;
if(pUnit->getItemID() == Unit_Harvester) {
HarvesterClass* pHarvester = (HarvesterClass*) pUnit;
if(pHarvester->getOwner()->isAI() == true) {
AI_SpiceHarvested += pHarvester->getAmountOfSpice();
} else {
Human_SpiceHarvested += pHarvester->getAmountOfSpice();
}
}
}
if(currentGame->CheatsEnabled() == true) {
rank = "Cheater";
} else {
int rankID = DuneText_SandFlea;
if(totalScore >= 25) rankID++;
if(totalScore >= 50) rankID++;
if(totalScore >= 100) rankID++;
if(totalScore >= 150) rankID++;
if(totalScore >= 200) rankID++;
if(totalScore >= 300) rankID++;
if(totalScore >= 400) rankID++;
if(totalScore >= 500) rankID++;
if(totalScore >= 700) rankID++;
if(totalScore >= 1000) rankID++;
if(totalScore >= 1400) rankID++;
// if(totalScore >= 1800) rankID++;
rank = pTextManager->getDuneText(rankID);
}
}