本文整理汇总了C++中Outfit::Piercing方法的典型用法代码示例。如果您正苦于以下问题:C++ Outfit::Piercing方法的具体用法?C++ Outfit::Piercing怎么用?C++ Outfit::Piercing使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Outfit
的用法示例。
在下文中一共展示了Outfit::Piercing方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateAttributes
//.........这里部分代码省略.........
attributeLabels.push_back("firing heat / second:");
attributeValues.push_back(Format::Number(60. * outfit.FiringHeat() / outfit.Reload()));
attributesHeight += 20;
}
if(outfit.FiringFuel() && outfit.Reload())
{
attributeLabels.push_back("firing fuel / second:");
attributeValues.push_back(Format::Number(60. * outfit.FiringFuel() / outfit.Reload()));
attributesHeight += 20;
}
bool isContinuous = (outfit.Reload() <= 1);
attributeLabels.push_back("shots / second:");
if(isContinuous)
attributeValues.push_back("continuous");
else
attributeValues.push_back(Format::Number(60. / outfit.Reload()));
attributesHeight += 20;
int homing = outfit.Homing();
if(homing)
{
static const string skill[] = {
"no",
"poor",
"fair",
"good",
"excellent"
};
attributeLabels.push_back("homing:");
attributeValues.push_back(skill[max(0, min(4, homing))]);
attributesHeight += 20;
}
static const string percentNames[] = {
"tracking:",
"optical tracking:",
"infrared tracking:",
"radar tracking:",
"piercing:"
};
double percentValues[] = {
outfit.Tracking(),
outfit.OpticalTracking(),
outfit.InfraredTracking(),
outfit.RadarTracking(),
outfit.Piercing()
};
for(unsigned i = 0; i < sizeof(percentValues) / sizeof(percentValues[0]); ++i)
if(percentValues[i])
{
int percent = 100. * percentValues[i] + .5;
attributeLabels.push_back(percentNames[i]);
attributeValues.push_back(Format::Number(percent) + "%");
attributesHeight += 20;
}
attributeLabels.push_back(string());
attributeValues.push_back(string());
attributesHeight += 10;
static const string names[] = {
"shield damage / shot:",
"hull damage / shot:",
"heat damage / shot:",
"ion damage / shot:",
"slowing damage / shot:",
"disruption damage / shot:",
"firing energy / shot:",
"firing heat / shot:",
"firing fuel / shot:",
"inaccuracy:",
"blast radius:",
"missile strength:",
"anti-missile:",
};
double values[] = {
outfit.ShieldDamage(),
outfit.HullDamage(),
outfit.HeatDamage(),
outfit.IonDamage() * 100.,
outfit.SlowingDamage() * 100.,
outfit.DisruptionDamage() * 100.,
outfit.FiringEnergy(),
outfit.FiringHeat(),
outfit.FiringFuel(),
outfit.Inaccuracy(),
outfit.BlastRadius(),
static_cast<double>(outfit.MissileStrength()),
static_cast<double>(outfit.AntiMissile())
};
static const int NAMES = sizeof(names) / sizeof(names[0]);
for(int i = (isContinuous ? 9 : 0); i < NAMES; ++i)
if(values[i])
{
attributeLabels.push_back(names[i]);
attributeValues.push_back(Format::Number(values[i]));
attributesHeight += 20;
}
}