当前位置: 首页>>代码示例>>C++>>正文


C++ CvPlot::setFeatureType方法代码示例

本文整理汇总了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);
				}
			}
		}
	}
}
开发者ID:Nightinggale,项目名称:Medieval_Tech,代码行数:29,代码来源:CvMapGenerator.cpp

示例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);
				}
			}
		}
	}
}
开发者ID:RichterBelmont,项目名称:BadgameBTSMod,代码行数:29,代码来源:CvMapGenerator.cpp

示例3: eraseFeatures

void CvMapGenerator::eraseFeatures()
{
	for (int i = 0; i < GC.getMapINLINE().numPlotsINLINE(); i++)
	{
		CvPlot* pPlot = GC.getMapINLINE().plotByIndexINLINE(i);
		pPlot->setFeatureType(NO_FEATURE);
	}
}
开发者ID:Nightinggale,项目名称:Medieval_Tech,代码行数:8,代码来源:CvMapGenerator.cpp

示例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;
开发者ID:Nightinggale,项目名称:Medieval_Tech,代码行数:67,代码来源:CvMapGenerator.cpp


注:本文中的CvPlot::setFeatureType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。