本文整理汇总了C++中Star::setReference方法的典型用法代码示例。如果您正苦于以下问题:C++ Star::setReference方法的具体用法?C++ Star::setReference怎么用?C++ Star::setReference使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Star
的用法示例。
在下文中一共展示了Star::setReference方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createRandomMap
void StarList::createRandomMap(double radius = 50, double density = 750)
{
double dFactor = radius/50;
dFactor = pow(dFactor, 3);
int starCount = (int)(1000 * dFactor) + SSGX::d100()-SSGX::d100();
Onomastikon* names = Onomastikon::instancePtr();
Star *starToDelete;
foreach (starToDelete,_stars)
delete starToDelete;
_stars.clear();
Star *newStar = 0;
for (int idx = 0; idx < starCount; idx++)
{
newStar = new Star(radius);
int die = SSGX::d10();
if (die < 3)
newStar->starName = names->greekName();
else if (die >=3 && die <= 8)
newStar->starName = names->sigla();
else {
QString nomen;
do {
nomen = names->pseudoNomen()+"'s star";
} while (nomen.length() == 0);
newStar->starName = nomen;
}
_stars.append(newStar);
if (idx == 0) {
newStar->starName = "(CORE) "+newStar->starName;
newStar->setX(0);
newStar->setY(0);
newStar->setZ(0);
newStar->setStarFullType("G2V");
newStar->setReference();
}
}
}