本文整理汇总了C++中CvPlot::GetNumAdjacentMountains方法的典型用法代码示例。如果您正苦于以下问题:C++ CvPlot::GetNumAdjacentMountains方法的具体用法?C++ CvPlot::GetNumAdjacentMountains怎么用?C++ CvPlot::GetNumAdjacentMountains使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CvPlot
的用法示例。
在下文中一共展示了CvPlot::GetNumAdjacentMountains方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PlotFoundValue
//.........这里部分代码省略.........
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
}
}
else // this tile is owned by someone else
{
// See if there are other cities nearby (only count major civs)
if (iClosestEnemyCity > iDistance)
{
if (pLoopPlot->isCity() && (pLoopPlot->getOwner() < MAX_MAJOR_CIVS))
{
iClosestEnemyCity = iDistance;
示例2: PlotFoundValue
//.........这里部分代码省略.........
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())
{
if (iCelticForestCount >= 3)
{