本文整理汇总了C++中Ship::Heat方法的典型用法代码示例。如果您正苦于以下问题:C++ Ship::Heat方法的具体用法?C++ Ship::Heat怎么用?C++ Ship::Heat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ship
的用法示例。
在下文中一共展示了Ship::Heat方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CheckLock
void Projectile::CheckLock(const Ship &target)
{
double base = hasLock ? 1. : .5;
hasLock = false;
// For each tracking type, calculate the probability that a lock will be
// lost in a given five-second period. Then, since this check is done every
// second, test against the fifth root of that probability.
if(weapon->Tracking())
hasLock |= Check(weapon->Tracking(), base);
// Optical tracking is about 15% for interceptors and 75% for medium warships.
if(weapon->OpticalTracking())
{
double weight = target.Mass() * target.Mass();
double probability = weapon->OpticalTracking() * weight / (200000. + weight);
hasLock |= Check(probability, base);
}
// Infrared tracking is 10% when heat is zero and 100% when heat is full.
if(weapon->InfraredTracking())
{
double probability = weapon->InfraredTracking() * min(1., target.Heat() + .1);
hasLock |= Check(probability, base);
}
// Radar tracking depends on whether the target ship has jamming capabilities.
// Jamming of 1 is enough to increase your chance of dodging to 50%.
if(weapon->RadarTracking())
{
double probability = weapon->RadarTracking() / (1. + target.Attributes().Get("radar jamming"));
hasLock |= Check(probability, base);
}
}
示例2: sprite
EscortDisplay::Icon::Icon(const Ship &ship, bool isHere)
: sprite(ship.GetSprite().GetSprite()),
isHere(isHere && !ship.IsDisabled()),
stackSize(1),
cost(ship.Cost()),
system((!isHere && ship.GetSystem()) ? ship.GetSystem()->Name() : ""),
low{ship.Shields(), ship.Hull(), ship.Energy(), ship.Heat(), ship.Fuel()},
high(low)
{
}