本文整理汇总了C++中CvPlot::isCoastalLand方法的典型用法代码示例。如果您正苦于以下问题:C++ CvPlot::isCoastalLand方法的具体用法?C++ CvPlot::isCoastalLand怎么用?C++ CvPlot::isCoastalLand使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CvPlot
的用法示例。
在下文中一共展示了CvPlot::isCoastalLand方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addLakes
void CvMapGenerator::addLakes()
{
PROFILE_FUNC();
if (gDLL->getPythonIFace()->pythonAddLakes() && !gDLL->getPythonIFace()->pythonUsingDefaultImpl())
{
return; // Python override
}
gDLL->NiTextOut("Adding Lakes...");
CvPlot* pLoopPlot;
int iI;
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 (!(pLoopPlot->isCoastalLand()))
{
if (!(pLoopPlot->isRiver()))
{
if (GC.getGameINLINE().getMapRandNum(GC.getXMLval(XML_LAKE_PLOT_RAND), "addLakes") == 0)
{
pLoopPlot->setPlotType(PLOT_OCEAN);
}
}
}
}
}
}
示例2: countCoastalLand
int CvArea::countCoastalLand() const
{
if (isWater())
{
return 0;
}
int iCount = 0;
for (int iI = 0; iI < GC.getMapINLINE().numPlotsINLINE(); iI++)
{
CvPlot* pLoopPlot = GC.getMapINLINE().plotByIndexINLINE(iI);
if (pLoopPlot->getArea() == getID())
{
if (pLoopPlot->isCoastalLand())
{
iCount++;
}
}
}
return iCount;
}
示例3: 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);
}
}
}
}
}
}
}
}
示例4: PlotFoundValue
//.........这里部分代码省略.........
if (eYield == NO_YIELD || eYield == YIELD_GOLD)
iGoldValue = ComputeGoldValue(pLoopPlot, pPlayer) * /*2*/ GC.getSETTLER_GOLD_MULTIPLIER();
if (eYield == NO_YIELD || eYield == YIELD_SCIENCE)
iScienceValue = ComputeScienceValue(pLoopPlot, pPlayer) * /*1*/ GC.getSETTLER_SCIENCE_MULTIPLIER();
if (eYield == NO_YIELD || eYield == YIELD_FAITH)
iFaithValue = ComputeFaithValue(pLoopPlot, pPlayer) * /*1*/ GC.getSETTLER_FAITH_MULTIPLIER();
if (pLoopPlot->getOwner() == NO_PLAYER) // there is no benefit if we already own these tiles
{
iHappinessValue = ComputeHappinessValue(pLoopPlot, pPlayer) * /*6*/ GC.getSETTLER_HAPPINESS_MULTIPLIER();
iResourceValue = ComputeTradeableResourceValue(pLoopPlot, pPlayer) * /*1*/ GC.getSETTLER_RESOURCE_MULTIPLIER();
if (iDistance)
iStrategicValue = ComputeStrategicValue(pLoopPlot, pPlayer, iDistance) * /*1*/ GC.getSETTLER_STRATEGIC_MULTIPLIER(); // the ring is included in the computation
}
iTotalFoodValue += iFoodValue;
iTotalHappinessValue += iHappinessValue;
iTotalProductionValue += iProductionValue;
iTotalGoldValue += iGoldValue;
iTotalScienceValue += iScienceValue;
iTotalFaithValue += iFaithValue;
iTotalResourceValue += iResourceValue;
iTotalStrategicValue += iStrategicValue;
iPlotValue += iRingModifier * ( iFoodValue + iHappinessValue + iProductionValue + iGoldValue + iScienceValue + iFaithValue + iResourceValue ) + iStrategicValue;
}
// for the central plot
if (iDistance==0)
vQualifiersPositive.push_back( CvString::format("raw plot value %d", iPlotValue).c_str() );
if (iDistance==1 && !pPlot->isCoastalLand(GC.getMIN_WATER_SIZE_FOR_OCEAN()) && pLoopPlot->isCoastalLand(GC.getMIN_WATER_SIZE_FOR_OCEAN()))
bIsAlmostCoast = true;
// if this tile is a NW boost the value just so that we force the AI to claim them (if we can work it)
if (pLoopPlot->IsNaturalWonder() && iPlotValue>0)
iPlotValue *= 15;
// lower value a lot if we already own this tile
if (iPlotValue > 0 && pLoopPlot->getOwner() == ePlayer && ePlayer != NO_PLAYER)
iPlotValue /= 2;
// add this plot into the total
workablePlots.push_back( SPlotWithScore(pLoopPlot,iPlotValue) );
// some civ-specific checks
FeatureTypes ePlotFeature = pLoopPlot->getFeatureType();
ImprovementTypes ePlotImprovement = pLoopPlot->getImprovementType();
ResourceTypes ePlotResource = pLoopPlot->getResourceType();
if (ePlotFeature == FEATURE_FOREST)
{
if (iDistance <= 5)
{
++iIroquoisForestCount;
if (iDistance == 1)
if (ePlotImprovement == NO_IMPROVEMENT)
++iCelticForestCount;
}
}
else if (ePlotFeature == FEATURE_JUNGLE)
{
if (iDistance <= iRange)
++iBrazilJungleCount;