本文整理汇总了C++中CvPlot::setFeatureType方法的典型用法代码示例。如果您正苦于以下问题:C++ CvPlot::setFeatureType方法的具体用法?C++ CvPlot::setFeatureType怎么用?C++ CvPlot::setFeatureType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CvPlot
的用法示例。
在下文中一共展示了CvPlot::setFeatureType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addFeatures
void CvMapGenerator::addFeatures()
{
PROFILE_FUNC();
CvPlot* pPlot;
int iI, iJ;
if (gDLL->getPythonIFace()->pythonAddFeatures() && !gDLL->getPythonIFace()->pythonUsingDefaultImpl())
{
return; // Python override
}
for (iI = 0; iI < GC.getMapINLINE().numPlotsINLINE(); iI++)
{
pPlot = GC.getMapINLINE().plotByIndexINLINE(iI);
FAssert(pPlot != NULL);
for (iJ = 0; iJ < GC.getNumFeatureInfos(); iJ++)
{
if (pPlot->canHaveFeature((FeatureTypes)iJ))
{
if (GC.getGameINLINE().getMapRandNum(10000, "addFeaturesAtPlot") < GC.getFeatureInfo((FeatureTypes)iJ).getAppearanceProbability())
{
pPlot->setFeatureType((FeatureTypes)iJ);
}
}
}
}
}
示例2: addFeatures
void CvMapGenerator::addFeatures()
{
PROFILE("CvMapGenerator::addFeatures");
if (gDLL->getPythonIFace()->callFunction(gDLL->getPythonIFace()->getMapScriptModule(), "addFeatures", NULL))
{
if (!gDLL->getPythonIFace()->pythonUsingDefaultImpl())
{
return;
}
}
for (int iI = 0; iI < GC.getMapINLINE().numPlotsINLINE(); iI++)
{
CvPlot* pPlot = GC.getMapINLINE().plotByIndexINLINE(iI);
FAssert(pPlot != NULL);
for (int iJ = 0; iJ < GC.getNumFeatureInfos(); iJ++)
{
if (pPlot->canHaveFeature((FeatureTypes)iJ))
{
if (GC.getGameINLINE().getMapRandNum(10000, "addFeaturesAtPlot") < GC.getFeatureInfo((FeatureTypes)iJ).getAppearanceProbability())
{
pPlot->setFeatureType((FeatureTypes)iJ);
}
}
}
}
}
示例3: eraseFeatures
void CvMapGenerator::eraseFeatures()
{
for (int i = 0; i < GC.getMapINLINE().numPlotsINLINE(); i++)
{
CvPlot* pPlot = GC.getMapINLINE().plotByIndexINLINE(i);
pPlot->setFeatureType(NO_FEATURE);
}
}
示例4: addEurope
//.........这里部分代码省略.........
case DIRECTION_SOUTH:
bEurope = (pPlot->getY_INLINE() < iWidthPercent * iGridHeight / 100 && pPlot->getX_INLINE() > iWidthPercent * iGridWidth / 100 && pPlot->getX_INLINE() < (100 - iWidthPercent) * iGridWidth / 100);
break;
default:
FAssertMsg(false, "Invalid direction");
break;
}
}
if (bEurope)
{
if (kEurope.getDomainsValid(DOMAIN_SEA))
{
for (int i = -iMinLandDistance; i <= iMinLandDistance && bEurope; i++)
{
for (int j = -iMinLandDistance; j <= iMinLandDistance && bEurope; j++)
{
CvPlot* pLoopPlot = ::plotXY(pPlot->getX_INLINE(), pPlot->getY_INLINE(), i, j);
if (pLoopPlot != NULL)
{
if (!pLoopPlot->isWater())
{
bEurope = false;
}
}
}
}
if (bEurope)
{
if (pPlot->getFeatureType() != NO_FEATURE && GC.getFeatureInfo(pPlot->getFeatureType()).isImpassable())
{
pPlot->setFeatureType(NO_FEATURE);
}
if (pPlot->isImpassable())
{
bEurope = false;
}
}
if (bEurope)
{
if (!pPlot->isEurope())
{
pPlot->setEurope(eEurope);
}
pPlot->setTradeScreenAccess(eEurope);
bAnyEuropeFound = true;
}
bEurope = true;
}
if (kEurope.getDomainsValid(DOMAIN_LAND))
{
switch ((DirectionTypes)iDir)
{
case DIRECTION_EAST:
if (pPlot->getX_INLINE() < (iGridWidth - kEurope.getMaxLandCoverage()))
{
bEurope = false;
}
break;