本文整理汇总了C++中CvPlot::isHills方法的典型用法代码示例。如果您正苦于以下问题:C++ CvPlot::isHills方法的具体用法?C++ CvPlot::isHills怎么用?C++ CvPlot::isHills使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CvPlot
的用法示例。
在下文中一共展示了CvPlot::isHills方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addRivers
void CvMapGenerator::addRivers()
{
PROFILE_FUNC();
if (gDLL->getPythonIFace()->pythonAddRivers() && !gDLL->getPythonIFace()->pythonUsingDefaultImpl())
{
return; // Python override
}
gDLL->NiTextOut("Adding Rivers...");
CvPlot* pLoopPlot;
CvPlot* pStartPlot;
int iPass;
int iRiverSourceRange;
int iSeaWaterRange;
int iI;
for (iPass = 0; iPass < 4; iPass++)
{
if (iPass <= 1)
{
iRiverSourceRange = GC.getXMLval(XML_RIVER_SOURCE_MIN_RIVER_RANGE);
}
else
{
iRiverSourceRange = (GC.getXMLval(XML_RIVER_SOURCE_MIN_RIVER_RANGE) / 2);
}
if (iPass <= 1)
{
iSeaWaterRange = GC.getXMLval(XML_RIVER_SOURCE_MIN_SEAWATER_RANGE);
}
else
{
iSeaWaterRange = (GC.getXMLval(XML_RIVER_SOURCE_MIN_SEAWATER_RANGE) / 2);
}
for (iI = 0; iI < GC.getMapINLINE().numPlotsINLINE(); iI++)
{
gDLL->callUpdater();
pLoopPlot = GC.getMapINLINE().plotByIndexINLINE(iI);
FAssertMsg(pLoopPlot != NULL, "LoopPlot is not assigned a valid value");
if (!(pLoopPlot->isWater()))
{
if (((iPass == 0) && (pLoopPlot->isHills() || pLoopPlot->isPeak())) ||
((iPass == 1) && !(pLoopPlot->isCoastalLand()) && (GC.getGameINLINE().getMapRandNum(8, "addRivers") == 0)) ||
((iPass == 2) && (pLoopPlot->isHills() || pLoopPlot->isPeak()) && (pLoopPlot->area()->getNumRiverEdges() < ((pLoopPlot->area()->getNumTiles() / GC.getXMLval(XML_PLOTS_PER_RIVER_EDGE)) + 1))) ||
((iPass == 3) && (pLoopPlot->area()->getNumRiverEdges() < ((pLoopPlot->area()->getNumTiles() / GC.getXMLval(XML_PLOTS_PER_RIVER_EDGE)) + 1))))
{
if (!(GC.getMapINLINE().findWater(pLoopPlot, iRiverSourceRange, true)))
{
if (!(GC.getMapINLINE().findWater(pLoopPlot, iSeaWaterRange, false)))
{
pStartPlot = pLoopPlot->getInlandCorner();
if (pStartPlot != NULL)
{
doRiver(pStartPlot);
}
}
}
}
}
}
}
}
示例2: PlotFoundValue
//.........这里部分代码省略.........
#else
if (iDistance <= NUM_CITY_RINGS)
#endif
{
++iWetlandsCount;
}
}
if (pLoopPlot->IsNaturalWonder())
{
if (iDistance <= 1)
{
++iNaturalWonderCount;
}
}
if (pLoopPlot->getTerrainType() == TERRAIN_DESERT)
{
#if defined(MOD_GLOBAL_CITY_WORKING)
if (iDistance <= pPlayer->getWorkPlotDistance())
#else
if (iDistance <= NUM_CITY_RINGS)
#endif
{
if (ePlotResource == NO_RESOURCE)
{
++iDesertCount;
}
}
}
if (bIsInca)
{
if (pLoopPlot->isHills())
{
#if defined(MOD_GLOBAL_CITY_WORKING)
if (iDistance <= pPlayer->getWorkPlotDistance())
#else
if (iDistance <= NUM_CITY_RINGS)
#endif
{
iAdjacentMountains = pLoopPlot->GetNumAdjacentMountains();
if (iAdjacentMountains > 0 && iAdjacentMountains < 6)
{
//give the bonus if it's hills, with additional if bordered by mountains
rtnValue += m_iIncaMultiplier + (iAdjacentMountains * m_iIncaMultiplier);
}
}
}
}
#if defined(MOD_BALANCE_CORE_SETTLER)
if (MOD_BALANCE_CORE_SETTLER)
{
if(pLoopPlot->isWater() && pLoopPlot->HasResource(NO_RESOURCE))
{
iWaterPlot++;
}
if(pLoopPlot == NULL || pLoopPlot->isImpassable() || pLoopPlot->getTerrainType() == TERRAIN_SNOW || pLoopPlot->getFeatureType() == FEATURE_ICE)
{
iBadPlot++;
}
}
#endif
}
}
示例3: PlotFoundValue
//.........这里部分代码省略.........
++iNaturalWonderCount;
}
if (pLoopPlot->isLake())
{
if (iDistance <= iRange)
++iLakeCount;
}
if (pLoopPlot->getResourceType(NO_TEAM) != NO_RESOURCE)
{
ResourceTypes eResource = pLoopPlot->getResourceType(eTeam);
if(eResource != NO_RESOURCE && GC.getResourceInfo(eResource)->getResourceUsage() == RESOURCEUSAGE_LUXURY)
{
if (iDistance <= iRange)
{
++iLuxuryCount;
}
}
}
if (pLoopPlot->getTerrainType() == TERRAIN_DESERT)
{
if (iDistance <= iRange)
{
if (ePlotResource == NO_RESOURCE)
{
++iDesertCount;
}
}
}
if (bIsInca)
{
if (pLoopPlot->isHills() && iDistance <= iRange)
{
iAdjacentMountains = pLoopPlot->GetNumAdjacentMountains();
if (iAdjacentMountains > 0 && iAdjacentMountains < 6)
{
//give the bonus if it's hills, with additional if bordered by mountains
iCivModifier += (iAdjacentMountains+1) * m_iIncaMultiplier;
vQualifiersPositive.push_back("(C) incan hills");
}
}
}
}
}
}
}
//take into account only the best 70% of the plots - in the near term the city will not work all plots anyways
std::stable_sort( workablePlots.begin(), workablePlots.end() );
size_t iIrrelevantPlots = workablePlots.size()*30/100;
for (size_t idx=iIrrelevantPlots; idx<workablePlots.size(); idx++)
{
SPlotWithScore& ref = workablePlots[idx];
iTotalPlotValue += ref.score;
}
if (iTotalPlotValue<0)
return 0;
//civ-specific bonuses
if (pPlayer)
{
if (pPlayer->GetPlayerTraits()->IsFaithFromUnimprovedForest())
{