本文整理汇总了C++中shared_ptr::Attributes方法的典型用法代码示例。如果您正苦于以下问题:C++ shared_ptr::Attributes方法的具体用法?C++ shared_ptr::Attributes怎么用?C++ shared_ptr::Attributes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类shared_ptr
的用法示例。
在下文中一共展示了shared_ptr::Attributes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Step
//.........这里部分代码省略.........
statuses.emplace_back(it->Position() - center, it->Shields(), it->Hull(),
max(20., width * .5), isEnemy);
}
}
// Create the planet labels.
labels.clear();
if(currentSystem && Preferences::Has("Show planet labels"))
{
for(const StellarObject &object : currentSystem->Objects())
{
if(!object.GetPlanet())
continue;
Point pos = object.Position() - center;
if(pos.Length() < 600. + object.Radius())
labels.emplace_back(pos, object, currentSystem);
}
}
if(flagship && flagship->IsOverheated())
Messages::Add("Your ship has overheated.");
if(flagship && flagship->Hull())
info.SetSprite("player sprite", flagship->GetSprite());
else
info.SetSprite("player sprite", nullptr);
if(currentSystem)
info.SetString("location", currentSystem->Name());
info.SetString("date", player.GetDate().ToString());
if(flagship)
{
info.SetBar("fuel", flagship->Fuel(),
flagship->Attributes().Get("fuel capacity") * .01);
info.SetBar("energy", flagship->Energy());
info.SetBar("heat", flagship->Heat());
info.SetBar("shields", flagship->Shields());
info.SetBar("hull", flagship->Hull(), 20.);
}
else
{
info.SetBar("fuel", 0.);
info.SetBar("energy", 0.);
info.SetBar("heat", 0.);
info.SetBar("shields", 0.);
info.SetBar("hull", 0.);
}
info.SetString("credits",
Format::Number(player.Accounts().Credits()) + " credits");
if(flagship && flagship->GetTargetPlanet() && !flagship->Commands().Has(Command::JUMP))
{
const StellarObject *object = flagship->GetTargetPlanet();
info.SetString("navigation mode", "Landing on:");
const string &name = object->Name();
info.SetString("destination", name);
targets.push_back({
object->Position() - center,
Angle(45.),
object->Radius(),
object->GetPlanet()->CanLand() ? Radar::FRIENDLY : Radar::HOSTILE});
}
else if(flagship && flagship->GetTargetSystem())
{
info.SetString("navigation mode", "Hyperspace:");
if(player.HasVisited(flagship->GetTargetSystem()))