本文整理汇总了C++中BattleUnit::getHealth方法的典型用法代码示例。如果您正苦于以下问题:C++ BattleUnit::getHealth方法的具体用法?C++ BattleUnit::getHealth怎么用?C++ BattleUnit::getHealth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BattleUnit
的用法示例。
在下文中一共展示了BattleUnit::getHealth方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateStats
/**
* Updates the soldier stats (Weight, TU).
*/
void InventoryState::updateStats()
{
BattleUnit *unit = _battleGame->getSelectedUnit();
_txtTus->setText(tr("STR_TIME_UNITS_SHORT").arg(unit->getTimeUnits()));
int weight = unit->getCarriedWeight(_inv->getSelectedItem());
_txtWeight->setText(tr("STR_WEIGHT").arg(weight).arg(unit->getBaseStats()->strength));
if (weight > unit->getBaseStats()->strength)
{
_txtWeight->setSecondaryColor(_game->getMod()->getInterface("inventory")->getElement("weight")->color2);
}
else
{
_txtWeight->setSecondaryColor(_game->getMod()->getInterface("inventory")->getElement("weight")->color);
}
_txtFAcc->setText(tr("STR_ACCURACY_SHORT").arg((int)(unit->getBaseStats()->firing * unit->getHealth()) / unit->getBaseStats()->health));
_txtReact->setText(tr("STR_REACTIONS_SHORT").arg(unit->getBaseStats()->reactions));
if (unit->getBaseStats()->psiSkill > 0)
{
_txtPSkill->setText(tr("STR_PSIONIC_SKILL_SHORT").arg(unit->getBaseStats()->psiSkill));
}
else
{
_txtPSkill->setText(L"");
}
if (unit->getBaseStats()->psiSkill > 0 || (Options::psiStrengthEval && _game->getSavedGame()->isResearched(_game->getMod()->getPsiRequirements())))
{
_txtPStr->setText(tr("STR_PSIONIC_STRENGTH_SHORT").arg(unit->getBaseStats()->psiStrength));
}
else
{
_txtPStr->setText(L"");
}
}